test: fix failing unit test for large stratum id (#546)

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.
This commit is contained in:
tdb3 2025-01-04 17:57:05 -05:00 committed by GitHub
parent b432d2747f
commit 5e56bcdccc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}
@ -165,4 +165,4 @@ TEST_CASE("Parse stratum result alternative error", "[stratum]")
TEST_ASSERT_EQUAL(STRATUM_RESULT, stratum_api_v1_message.method);
TEST_ASSERT_FALSE(stratum_api_v1_message.response_success);
TEST_ASSERT_EQUAL("Above target 2", stratum_api_v1_message.error_str);
}
}