Skip to content

Commit

Permalink
test: fix stratum alternative error test (#608)
Browse files Browse the repository at this point in the history
The test now checks for the expected id and reject-reason

Co-authored-by: WantClue <86001033+WantClue@users.noreply.github.com>
  • Loading branch information
tdb3 and WantClue authored Jan 8, 2025
1 parent 1ea422f commit b5d1e36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/stratum/test/test_stratum_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ TEST_CASE("Parse stratum result error", "[stratum]")
TEST_CASE("Parse stratum result alternative error", "[stratum]")
{
StratumApiV1Message stratum_api_v1_message = {};
const char *json_string = "{\"reject-reason\":\"Above target\",\"result\":false,\"error\":null,\"id\":8}";
const char *json_string = "{\"reject-reason\":\"Above target 2\",\"result\":false,\"error\":null,\"id\":8}";
STRATUM_V1_parse(&stratum_api_v1_message, json_string);
TEST_ASSERT_EQUAL(1, stratum_api_v1_message.message_id);
TEST_ASSERT_EQUAL(8, 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);
TEST_ASSERT_EQUAL("Above target 2", stratum_api_v1_message.error_str);
TEST_ASSERT_EQUAL_STRING("Above target 2", stratum_api_v1_message.error_str);
}

0 comments on commit b5d1e36

Please sign in to comment.