Skip to content

Commit

Permalink
fix bip44 device self-test
Browse files Browse the repository at this point in the history
  • Loading branch information
janmazak committed May 17, 2022
1 parent 48fefac commit 0221277
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/bip44.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ size_t bip44_printToStr(const bip44_path_t* pathSpec, char* out, size_t outSize)
ASSERT(outSize < BUFFER_SIZE_PARANOIA);
// we need space for the terminating \0
// and one more byte to check whether
// snprintf has enough space to print everything
// everything was printed
ASSERT(outSize >= BIP44_PATH_STRING_SIZE_MAX + 1);
char* ptr = out;
char* end = (out + outSize);
Expand Down
10 changes: 5 additions & 5 deletions src/bip44_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ void run_bip44_test()
}

TESTCASE(
(1, 2, 3, 4, 5), BIP44_PATH_STRING_SIZE_MAX,
(1, 2, 3, 4, 5), BIP44_PATH_STRING_SIZE_MAX + 1,
"m/1/2/3/4/5"
);
TESTCASE(
(1, 2, 3, 4, 5), 12,
(1, 2, 3, 4, 5), BIP44_PATH_STRING_SIZE_MAX + 1,
"m/1/2/3/4/5"
);
TESTCASE(
(), 2,
(), BIP44_PATH_STRING_SIZE_MAX + 1,
"m"
);
TESTCASE(
(HD + 44, HD + 1815, HD + 0, 1, 55), BIP44_PATH_STRING_SIZE_MAX,
(HD + 44, HD + 1815, HD + 0, 1, 55), BIP44_PATH_STRING_SIZE_MAX + 1,
"m/44'/1815'/0'/1/55"
);
TESTCASE(
(HD + 44, HD + 1815), 60,
(HD + 44, HD + 1815), BIP44_PATH_STRING_SIZE_MAX + 1,
"m/44'/1815'"
);
#undef TESTCASE
Expand Down

0 comments on commit 0221277

Please sign in to comment.