summaryrefslogtreecommitdiff
path: root/test_libgps.c
Commit message (Collapse)AuthorAgeFilesLines
* test_libgps: minor reformat for line length.Gary E. Miller2018-09-251-2/+3
|
* Savannah issue #53671: policy_t -> gps_policy_t.Gary E. Miller2018-07-261-1/+1
| | | | | | This is to prevent a conflict with Boost version 1.67. No functional change.
* gps_read(): fix some nasty buffer overruns and corruptions.Gary E. Miller2018-07-141-2/+3
| | | | | | | Now pass an optional message buffer to gps_read(). Finally the JSON display in cgps works. Thanks to Virgin Orbit for their support fixing this bug.
* Windows libgps supportRobert Norris2017-02-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Windows versions for network functions and disable unused features. Add detection of various headers and functions that aren't available in Windows. Note that netlib_localsocket() has no functional implementation on Windows, but it isn't to be used on that platform and it's not part of libgps anyway. Using send() rather than write() seems to work on Windows. For Windows need to ensure networking is initialised on opening of sockets (and then correspondingly shutdown upon closing). Note that within gpsd.h the termios structures and serial related functions are removed from the Windows build. These are only accessed in serial.c by gpsd, so since the Windows build is only generating libgps there is currently no need to modify serial.c. And for os_compat.h, daemon() is simply disabled under Windows as it's not used within libgps. TESTED: Confirmed compiles under a cross compiler. Manual build and run of test_libgps on Windows which successfully connects to a host running GPSD Manual build DLL version and link with a Windows version of a program (Viking) that then successfully connects and monitors positions from GPSD Otherwise no effect on current supported systems. 'scons build-all check' - passes. Signed-off-by: Fred Wright <fw@fwright.net>
* Fix warning: array subscript has type 'char'Greg Troxel2016-08-121-1/+1
| | | | | | On NetBSD: -Wchar-subscripts Signed-off-by: Gary E. Miller <gem@rellim.com>
* mprove test_libgps to detect gps_send() and gps_read() errors.Robert Norris2016-07-141-2/+10
| | | | | | All return codes shauold always be checked. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Building test_libgps can fail with specifc build options.Robert Norris2016-07-141-2/+6
| | | | | | | | | | | | | | test_libgps will fail with this build command: scons shared=True socket_export=True minimal=True test_libgps resulting with undefined reference to 'libgps_dump_state' errors As test_libgps would force debugging on, yet libgps_dump_state() is compiled out. Simply wrap libgps_dump_state() calls with suitable ifdefs and don't force the LIBGPS_DEBUG define in code. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Move declarations of libgps_debug related functions and definitions.Rob Norris2016-03-081-1/+2
| | | | | | | | | Move from gpsd.h to libgps.h This is the more logical place for this code and removes the dependency of test_libgps.c on gpsd.h Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
* Make the test_libgps program more useful by allowing to specify the server ↵Rob Norris2016-02-231-8/+22
| | | | | | | | and port. Use gpsd_source_spec() as per usage in cgps. Since this now uses the unnamed command line parameter, add new '-f' mode to forward (i.e. send) data specified on the command line to gpsd.
* Fix test_libgps program as it always reports "Daemon is not running" for a ↵Rob Norris2016-02-191-1/+1
| | | | | | | | | | successful gps_open() call. gps_open() returns 0 on success or a negative number on failure. Thus the right test is either '!= 0' (or just '< 0') rather than '<= 0'. The operator '!=' is preferred since that is how the other programs cgps, gpspipe, etc... use gps_open() Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-3/+0
| | | | | | | | | | | | | | | | | | | The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
* Fixing broken minimal=on for test_libgpsJon Schlueter2015-03-251-0/+14
| | | | | | | scons minimal=on leapfetch=off python=on test_libgps failed Missing guards for CLIENTDEBUG_ENABLE and SOCKET_EXPORT_ENABLE in test_libgps.c
* Always use sizeof to get array sizeZbigniew Chyla2015-01-131-2/+2
| | | | | | Don't use constant/expression from an array's definition when referring to its size. Eliminates redundancy and avoids problems when array size changes. The change doesn't affect generated code.
* Build and regressions now work with minimal either on or off.Eric S. Raymond2014-09-061-0/+2
|
* Replace exit({0,1}) with exit(EXIT_{SUCCESS,FAILURE})Eric S. Raymond2012-09-071-4/+4
| | | | Note there are some exit(2) instances we bneed to decide what to do with.
* Usage comment fix.Eric S. Raymond2011-04-161-1/+1
|
* libdbus configuration is a nest of snakesEric S. Raymond2011-04-031-0/+2
|
* Break the libgps test code our of libgps_core.c.Eric S. Raymond2011-04-031-0/+108