Share directly executed tests and generated wrappers between Automake primaries. Keep entries one per line to reduce conflicts when independent changes add coverage.
The Dummy backend retained caller-owned string pointers in its parameter
array, leaving BANDSELECT and KEYERTYPE dangling after the caller returned.
Deep-copy string parameters, release replacements during cleanup, and add
set/get ownership regressions for both string-valued parameters.
Exercise command stream failures, hexadecimal byte formats, backend truncation and framing, metadata absence, and physical-device reply boundaries with focused valid and malformed cases. Ignore the generated test binaries and harness logs.
NET rigctl and Quisk reused an old loop index while parsing
peer-provided AGC levels, which could write past the fixed array.
Use a shared bounded parser that truncates the list to the array
capacity and ignores malformed fields without failing the connection.
Fixes: 652e12a446 ("Fix cppcheck style")
Concurrent calls to rig_debug() could use the same temporary buffer
and corrupt the saved debug history.
Give each call its own buffer and update the shared history under the
existing mutex.
The utility requires eight arguments but #3, baud, is ignored which
seems to leave it broken and has been ignored for about as long as the
code has been in the repository. There is also no documentation on the
intended usage of this utility.
Will restore when these issues are resolved.
As reported in GitHub issue #1892, configure on FreeBSD failed to search
for the name of the library correctly which is libusb. As pkg-config
correctly holds the library name for linking, modify the search for
libusb-1.0 to use the pkg-config capability. If pkg-config (now largely
replaced by pkgconf) is not installed or found, the modules depending on
it will be gracefull disabled, i.e. the configure script will complete
with those modules disabled.
Modify the output summary to use spaces instead of tabs as things were
not lining up nicely in my FreeBSD terminal.
Rename the Automake substituted variable 'HAVE_LIBUSB' to
'TESTS_HAVE_LIBUSB' to avoid confusion with identically named variable
written to include/hamlib/config.h.
Likewise, rename the AutoConf substituted name 'LIBUSB' to
'HAMLIB_PC_LIBUSB' to avoid confusion with the 'LIBUSB' string passed to
PKG_CHECK_MODULES.
Update hamlib.pc.in and tests/Makefile.am to use the new variable names.
Make sure all source files no longer reference HAVE_LIBUSB_H or
HAVE_LIBUSB_1_0_LIBUSB_H as these variables no longer exist.
Fix src/Makefile.am to provide include path for usb_port.c.
At some time, the commented out line check_PROGRAMS removed by this commit was
identical to the line following it, plus testsecurity appended, then they went
out of sync.
The commented out line check_PROGRAMS added by this commit appends testsecurity
in an explicit way.
This commit has been left as documentation should these files be moved
to /doc or some such. However, never of these files are built or
distributed.
----------------
From example.c the following warning was generated by MinGW:
CC example.o
example.c: In function ‘main’:
example.c:93:32: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘rmode_t’ {aka ‘long long unsigned int’} [-Wformat=]
93 | printf("Current mode = 0x%lX = %s, width = %ld\n", mode, rig_strrmode(mode),
| ~~^ ~~~~
| | |
| long unsigned int rmode_t {aka long long unsigned int}
| %llX
The 'l' was added as suggested to the format specifier but that resulted
in the following warning from Linux:
CC example.o
../../hamlib/tests/example.c:93:57: warning: format specifies type 'unsigned long long' but the argument has type 'rmode_t' (aka 'unsigned long') [-Wformat]
printf("Current mode = 0x%llX = %s, width = %ld\n", mode, rig_strrmode(mode),
~~~~ ^~~~
%lX
CC rigctl-dumpcaps.o
1 warning generated.
So casting `mode` to `unsigned long long` quelled both warnings!
From testsecurity.c came this warning:
CC testsecurity-testsecurity.o
In file included from ../include/hamlib/rig.h:49,
from ../src/misc.h:26,
from testsecurity.c:29:
/usr/share/mingw-w64/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
15 | #warning Please include winsock2.h before windows.h
| ^~~~~~~
Apparently winsock2.h being included through misc.h didn't work.
Finally, the Mingw linker gave the following error:
CCLD testsecurity.exe
/usr/bin/x86_64-w64-mingw32-ld: testsecurity-testsecurity.o: in function `main':
/home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:97:(.text.startup+0x87): undefined reference to `AESStringCrypt'
/usr/bin/x86_64-w64-mingw32-ld: /home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:116:(.text.startup+0x128): undefined reference to `AESStringDecrypt'
collect2: error: ld returned 1 exit status
Specifcally add the libsecurity.la file path as a specific library.
Even though the libhamlib.la seems to have the AESStringCrypt symbol
already.
This makes it possible to run "make -C src/" or "make -C tests/ rigctl"
or "make -C bindings/ check" (and so on) in a clean tree, but it doesn't
rebuild those targets if libhamlib.la is changed; for this run make from
the top directory as usual, to rebuild all SUBDIRS if needed.
Change l METER to return meter number=name instead of just number
Hopefully doesn't mess up anybody using this function via rigctl/rigctld uf they parsing the number correctly.
It's easier for users with to use/see text names for both set/get
https://github.com/Hamlib/Hamlib/issues/1369