Skip to content

Commit

Permalink
fixup! congure_test: initial import of CongURE test framework
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Feb 9, 2021
1 parent 90b0fb3 commit 1a67d29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sys/congure/test/congure_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ int congure_test_call_init(int argc, char **argv)
{
congure_test_snd_t *c = congure_test_get_state();
uint32_t ctx;
size_t arglen;

if (!_check_driver(c)) {
return 1;
Expand All @@ -87,11 +88,12 @@ int congure_test_call_init(int argc, char **argv)
print_str("{\"error\":\"`ctx` argument expected\"}\n");
return 1;
}
if ((argv[1][0] != '0') && (argv[1][1] != 'x')) {
arglen = strlen(argv[1]);
if ((arglen < 3) || ((argv[1][0] != '0') && (argv[1][1] != 'x'))) {
print_str("{\"error\":\"`ctx` expected to be hex\"}\n");
return 1;
}
ctx = scn_u32_hex(&argv[1][2], strlen(argv[1]) - 2);
ctx = scn_u32_hex(&argv[1][2], arglen - 2);
c->super.driver->init(&c->super, (void *)((intptr_t)ctx));
return 0;
}
Expand Down

0 comments on commit 1a67d29

Please sign in to comment.