Skip to content

Commit

Permalink
test: fix failing unit test for large stratum id
Browse files Browse the repository at this point in the history
PR #243 changes the type of id to int64_t,
allowing for ids exceeding a 16-bit integer.
Adjusts an associated unit test to ensure that
16-bit rollover wouldn't occur.
  • Loading branch information
tdb3 committed Dec 3, 2024
1 parent 468718a commit 7573526
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/stratum/test/test_stratum_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ TEST_CASE("Parse stratum result success with large id", "[stratum]")
StratumApiV1Message stratum_api_v1_message = {};
const char *json_string = "{\"id\":32769,\"error\":null,\"result\":true}";
STRATUM_V1_parse(&stratum_api_v1_message, json_string);
TEST_ASSERT_EQUAL(32768, stratum_api_v1_message.message_id);
TEST_ASSERT_EQUAL(32769, stratum_api_v1_message.message_id);
TEST_ASSERT_EQUAL(STRATUM_RESULT, stratum_api_v1_message.method);
TEST_ASSERT_TRUE(stratum_api_v1_message.response_success);
}
Expand All @@ -153,4 +153,4 @@ TEST_CASE("Parse stratum result error", "[stratum]")
TEST_ASSERT_EQUAL(1, stratum_api_v1_message.message_id);
TEST_ASSERT_EQUAL(STRATUM_RESULT, stratum_api_v1_message.method);
TEST_ASSERT_FALSE(stratum_api_v1_message.response_success);
}
}

0 comments on commit 7573526

Please sign in to comment.