Skip to content

Add unit tests for TypeHelpers conversions#66

Open
gretel wants to merge 1 commit into
pothosware:masterfrom
gretel:pr/tests
Open

Add unit tests for TypeHelpers conversions#66
gretel wants to merge 1 commit into
pothosware:masterfrom
gretel:pr/tests

Conversation

@gretel
Copy link
Copy Markdown

@gretel gretel commented May 1, 2026

Add unit tests for TypeHelpers conversions

Changed

  • New tests/test_type_helpers.cpp: 15 cases covering the 10 free functions in TypeHelpers.hpp (dict<->kwargs, meta_range<->RangeList, sensor_value_t<->ArgInfo).
  • New tests/CMakeLists.txt registering test_type_helpers via add_test().
  • Root CMakeLists.txt: add_subdirectory(tests).
  • .github/workflows/build.yml: ctest --test-dir build --output-on-failure step in all three jobs.

Why

TypeHelpers.hpp is shared by both modules (Soapy<-UHD and UHD<-Soapy); regressions there are silent at build time. The harness is bare stdlib (<cassert> + a CHECK macro) so no test framework dependency is added.

Adds tests/test_type_helpers.cpp covering the free functions in
TypeHelpers.hpp (dictToKwargs, kwargsToDict, metaRangeToRangeList,
rangeListToMetaRange, metaRangeToRange, numberListToMetaRange,
metaRangeToNumericList, rangeToMetaRange, sensorToArgInfo,
argInfoToSensor).

The harness is bare stdlib (cassert/iostream + a CHECK macro) to
avoid pulling in a test framework dependency. 15 cases, all
behavior-only, no hardware required.

Wire-up: tests/ added via add_subdirectory; ctest invocation added
to all three GitHub Actions jobs.

Signed-off-by: tom <robot@jitter.eu>
@gretel gretel marked this pull request as ready for review May 1, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant