Repository navigation
Add server protocol tests ported from thingset-node-c - #78
Merged
Merged
Conversation
Request/response tests for get, fetch, update and exec in binary and text mode, plus cross-mode round trips (update in one mode, get in the other) for each value type. The cases, data model and expected responses follow thingset-node-c's tests/protocol and tests/serde, so they also check the two implementations behave the same. Where thingset++ currently differs, the test expects thingset-node-c's behaviour and is disabled, with a note saying what thingset++ does instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
amitchone
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
tests/TestServerProtocol.cpp: request/response tests for the server, ported from thingset-node-c'stests/protocolandtests/serde. Because the cases and expected responses come from thingset-node-c, they also check that the two implementations behave the same.What's covered
handleBinaryRequest/handleTextRequest.19 00 FF.A fixture rebuilds part of thingset-node-c's test data model (
Types,Arrays,Exec,Access,Nested), with the same names and with IDs offset by 0xB000 so they don't collide with other tests. Error responses are checked by status code only, since thingset-node-c also sends a diagnostic message.Disabled tests
38 tests pass. 29 are
DISABLED_because thingset++ currently behaves differently. Each expects thingset-node-c's behaviour and has a comment saying what thingset++ does instead. All 29 currently fail with--gtest_also_run_disabled_tests.Bugs:
<instead of<=), and signed ones have no lower bound (-129 intoint8_tbecomes 127)256intouint8_tbecomes 0)true/false, so a list ending in a bool fails (e.g. calling a function with a bool parameter)inf/nanare written as bareinf/nan(not valid JSON)Differences from thingset-node-c that may be design decisions:
?Types ["wF32","wBool"]) isn't supported; text mode treats it as a getnull) and leaves functions out1/0[]A0(thingset-node-cAF), and exec of a non-function givesA0(thingset-node-cA3)Fixes for the first three bugs, and for bools in text mode, will follow in a separate PR that re-enables their tests.
🤖 Generated with Claude Code