Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
fix(test): Allow driver_core_cli_init take NULL
Browse files Browse the repository at this point in the history
To integrate driver_core into CI, and using concise CI scripts,
we should allow function `driver_core_cli_init()` to take a NULL
argument. Once a NULL argument of `driver_test_cases_t` is provided,
even though testing command `T` and `H` are assigned, no tags and
hashes will be set.
  • Loading branch information
howjmay committed Apr 17, 2020
1 parent dc67b3c commit 525c51e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/api/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ status_t driver_core_cli_init(ta_core_t* const core, int argc, char** argv, driv
exit(EXIT_SUCCESS);
case 'H':
// Take the arguments as testing transaction hashes
for (int i = 0; i < TXN_HASH_NUM; i++) {
if (!test_cases->txn_hash[i]) {
test_cases->txn_hash[i] = optarg;
if (test_cases) {
for (int i = 0; i < TXN_HASH_NUM; i++) {
if (!test_cases->txn_hash[i]) {
test_cases->txn_hash[i] = optarg;
}
}
}
break;
case 'T':
// Take the arguments as testing transaction tag
test_cases->tag = optarg;
if (test_cases) {
test_cases->tag = optarg;
}
break;
default:
ret = cli_core_set(core, key, optarg);
Expand Down

0 comments on commit 525c51e

Please sign in to comment.