Commit graph

171 commits

Author SHA1 Message Date
David Christle
5bc6deefe1
refactor(tests): split test registration into stable lists
Share directly executed tests and generated wrappers between Automake primaries. Keep entries one per line to reduce conflicts when independent changes add coverage.
2026-08-02 10:41:57 -07:00
David Christle
eff25c9472
fix(dummy): copy string parameter values
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.
2026-07-31 21:27:17 -07:00
David Christle
5293dbb855
test(parsers): add boundary regressions
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.
2026-07-27 23:33:09 -05:00
David Christle
e80cc8fd82 fix: prevent network AGC parser overflow
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")
2026-07-25 00:03:53 -05:00
David Christle
cf3fcc4b8a
fix(debug): prevent race in debug history capture
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.
2026-07-23 22:32:22 -05:00
Gong BI1XJT
60fb8e5fa0 Remove old-fashioned and buggy Android.mk build system
Signed-off-by: Gong BI1XJT <bi1xjt@rad1o.cn>
2026-05-17 22:49:59 +08:00
Gong BI1XJT
1f2cebac17 Correct the linkage of tests/* against Android Sensor rot
Signed-off-by: Gong BI1XJT <bi1xjt@rad1o.cn>
2026-05-17 21:02:25 +08:00
Nate Bargmann
6b9bd14d24
Pause building and installing rigfreqwalk
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.
2026-02-14 13:50:06 -06:00
Nate Bargmann
95cd7391a2
Merge GitHub PR #1917 2025-09-19 08:07:16 -05:00
Nate Bargmann
d04364e685
Use pkgconf/pkg-config to test for libusb-1.0
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.
2025-09-17 21:31:37 -05:00
Nate Bargmann
fd68f38743
Merge GitHub PR #1914 2025-09-17 20:12:20 -05:00
George Baltz N3GB
409949194e Once more into the breech... 2025-09-17 21:08:30 -04:00
Daniele Forsi IU5HKX
fb04375e36 Fix build failure when trying to build tests on a clean tree
Fixes:
make: *** No rule to make target '../lib/libmisc.la', needed by 'rigctl'.

Steps to reproduce:
make clean
make -j12 -C tests
2025-09-18 00:01:01 +02:00
Daniele Forsi IU5HKX
2a01ecdc5d Fix setting the variable HAVE_LIBUSB for makefiles 2025-09-14 17:09:09 +02:00
Daniele Forsi IU5HKX
5ba906c9aa Document building testsecurity
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.
2025-08-21 09:03:59 +02:00
Daniele Forsi IU5HKX
844bd8eba8 Remove unneeded dependencies
make knows how to build an executable from a single C source file
2025-08-21 09:03:59 +02:00
Daniele Forsi IU5HKX
b5db8e3200 Add conditionally generated file to .gitignore and CLEANFILES
No need to add it *conditionally* to CLEANFILES because for make
it isn't an error trying to delete a file that doesn't exist.
2025-08-21 09:03:59 +02:00
Nate Bargmann
3fa91c8771
Document fixing MinGW warnings and linker error
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.
2025-08-18 17:24:08 -05:00
Daniele Forsi IU5HKX
edda52b40e
[tests] Fix search path for includes 2025-08-18 09:02:08 -05:00
Daniele Forsi IU5HKX
26412650a6
[tests] Add other existing test scripts
Adds: amptest.sh and testcaps.sh
Doesn't add cachetest.sh because it needs 2 instances of rigctld running.
2025-08-18 09:02:07 -05:00
Daniele Forsi IU5HKX
d4eee93c85
[tests] Add missing files to EXTRA_DIST 2025-08-18 09:02:07 -05:00
Daniele Forsi IU5HKX
53e27d6e88
[tests] Split and sort the list of EXTRA_DIST files 2025-08-18 09:02:07 -05:00
Daniele Forsi IU5HKX
3c214ed676
Make it easier to see what tests are missing
Sorts the list of tests.
2025-08-18 07:47:13 -05:00
jeremybox
0d079d2338 Restore tests/Makefile.am to match master branch exactly 2025-08-02 22:18:36 -04:00
jeremybox
971ab5e126 Remove test_ftx1 from Makefile to fix build issues
- Removed test_ftx1 from check_PROGRAMS list
- Removed test_ftx1_SOURCES definition
- This prevents build failures on systems without the test file
2025-08-02 22:12:46 -04:00
jeremybox
bb070edfa3 Enhanced FTX-1 support with comprehensive improvements 2025-08-02 22:02:05 -04:00
Daniele Forsi IU5HKX
5c05881e0e Add rules to build dependencies of libhamlib.la in other directories
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.
2025-05-08 23:51:47 +02:00
Daniele Forsi IU5HKX
cfc5c821a0 Delete a generated file when doing make clean 2025-04-16 19:48:56 +02:00
Mike Black W9MDB
d8a9968fac Add test2038.sh to clean 2024-01-24 12:19:38 -06:00
Mike Black W9MDB
1b5fbc1d8b Add 2038 test during build -- make check will fail is there is a 2038 problem
https://github.com/Hamlib/Hamlib/issues/1478
2024-01-24 10:45:32 -06:00
Mike Black W9MDB
45dca3be59 Add dumpcap include files to test/Makefile.am 2023-11-05 17:34:49 -06:00
Mike Black W9MDB
24e407c82c Fix github build 2023-08-20 16:34:35 -05:00
Mike Black W9MDB
cca3891362 Change L METER to allow meter names in addition to numeric
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
2023-08-20 16:03:25 -05:00
Mike Black W9MDB
24f17730f4 Add \test command to rigctl -- first test routine is "cw"
https://github.com/Hamlib/Hamlib/issues/1281
2023-07-04 17:31:07 -05:00
Mike Black W9MDB
a6de41e206 rigctld can now see RIG_LEVEL values correctly
https://github.com/Hamlib/Hamlib/issues/1305
2023-06-03 16:50:30 -05:00
Mike Black W9MDB
f55e7b8348 Rename multicast test routines and clean up things a bit
Now works on mingw32 and Linux
https://github.com/Hamlib/Hamlib/issues/695
2023-05-07 23:23:01 -05:00
Mike Black W9MDB
62b9a12e89 Add multicastserver test
Fix compile warnings on mingw
2023-05-07 17:17:50 -05:00
Mike Black W9MDB
65a3305fa8 Add multicastclient to tests/Makefile.am
https://github.com/Hamlib/Hamlib/issues/695
2023-05-07 13:22:38 -05:00
Mike Black W9MDB
9bc5c4a883 Add rigctlsync utility to allow synchornizing a rig to SDR# 2023-01-27 23:35:31 -06:00
Mike Black W9MDB
6f6379e547 Add hamlibmodels to Makefile.am 2023-01-18 08:38:43 -06:00
Mike Black W9MDB
c7b33ef0b3 Fix ID5100 ID4100 ID31 ID51 get/set freq
Remove get_powerstat from ID4100 ID31 ID51 as it they are not capable
Add new rig_is_model function to help with Icom rig identification checks
https://github.com/Hamlib/Hamlib/issues/1202
https://github.com/Hamlib/Hamlib/issues/1200
2023-01-02 11:30:52 -06:00
Mike Black W9MDB
712564a2ae Revert "TS-890S query rig to find out which meter type the operator has selected"
Committed a bit too much
This reverts commit 2fc1d157ba.
2023-01-01 16:39:25 -06:00
Mike Black W9MDB
2fc1d157ba TS-890S query rig to find out which meter type the operator has selected
Thanks to N3GB George Baltz
2023-01-01 16:33:46 -06:00
Mike Black W9MDB
5c6e92a089 Change make_md5 to rig_make_md5 and export for the DLL build
https://github.com/Hamlib/Hamlib/issues/813
2022-04-15 22:44:53 -05:00
Mike Black W9MDB
ad2e3bb0ee Move md5.h to src 2022-04-15 17:49:00 -05:00
Mike Black W9MDB
b3d93cc231 Remove testsecurity from tests/Makefile.am
Will implement later
https://github.com/Hamlib/Hamlib/issues/813
2022-02-28 13:08:41 -06:00
Mike Black W9MDB
9e2ac43631 Move security/security_test to tests/testsecurity
https://github.com/Hamlib/Hamlib/issues/813
2022-02-28 12:54:04 -06:00
Mike Black W9MDB
0080044fb1 Remove redundnat testrigcaps in tests/Makefile check 2021-12-30 09:09:42 -06:00
Mike Black W9MDB
d2d622a3e8 Add testrigcaps to make check
https://github.com/Hamlib/Hamlib/issues/905
2021-12-27 17:02:42 -06:00
Mike Black W9MDB
3da4a9ea74 Revert "Revert "Add testgrid and move grid lat/lon functions to rig.h""
This reverts commit 1601375f7a.
2021-12-26 10:07:24 -06:00