Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix stratum alternative error unit test #608

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

tdb3
Copy link
Contributor

@tdb3 tdb3 commented Jan 4, 2025

Unit test Parse stratum result alternative error was failing.
Reviewed stratum_api.c to confirm the appropriate parsing flow and adjusted the unit test accordingly.

Previously, the test was checking for message ID 1 (when the message contained id 8). Maybe this a copy/paste error? (let me know if I'm mistaken)
Additionally, now the test uses TEST_ASSERT_EQUAL_STRING to check the reject-reason string, and the string was
adjusted to match the message.

To build the unit tests, perform an interactive rebase to temporarily drop commit 61042d9 (see #607), (e.g. https://stackoverflow.com/a/1338758/26342368)

The test now passes:

Running Parse stratum result alternative error...
/home/dev/myrepos/ESP-MinerAlt/ESP-Miner/components/stratum/test/test_stratum_json.c:159:Parse stratum result alternative error:PASS

The test now checks for the expected id and reject-reason
@tdb3 tdb3 force-pushed the 20250104_fix_alt_err_test branch from baaecf3 to e0ff3fb Compare January 4, 2025 13:58
@WantClue
Copy link
Collaborator

WantClue commented Jan 4, 2025

@tdb3 this should fix the merge conflict hopefully correctly

@tdb3
Copy link
Contributor Author

tdb3 commented Jan 5, 2025

Thank you @WantClue

@eandersson eandersson merged commit b5d1e36 into skot:master Jan 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants