Skip to content

Commit

Permalink
Fix cutest warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aleixalcacer authored and FrancescAlted committed Apr 7, 2022
1 parent 5f5213c commit 625b23e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/cutest.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ typedef struct {
} cutest_param_t;

static cutest_param_t cutest_params[CUTEST_PARAMS_MAX] = {0};
static int32_t cutest_params_ind[CUTEST_PARAMS_MAX] = {0};
static int8_t cutest_params_ind[CUTEST_PARAMS_MAX] = {0};


void _cutest_parametrize(char* name, void *params, int32_t params_len, int32_t param_size) {
Expand Down Expand Up @@ -161,19 +161,18 @@ int _cutest_run(int (*test)(void *), void *test_data, char *name) {
}

char test_name[MAXLEN_TESTNAME];
int count = 0;
uint8_t count = 0;
int num = niters;
do { count++; num /= 10;} while(num != 0);
for (int niter = 0; niter < niters; ++niter) {
sprintf(test_name, "[%0*d/%d] %s(", count, niter + 1, niters, name);
for (int i = 0; i < nparams; ++i) {
cutest_params_ind[i] = niter / params_strides[i] % cutest_params[i].params_len;
cutest_params_ind[i] = (int8_t) (niter / params_strides[i] % cutest_params[i].params_len);
snprintf(test_name, MAXLEN_TESTNAME, "%s%s[%d], ", test_name, cutest_params[i].name,
cutest_params_ind[i]);
}
test_name[strlen(test_name) - 1] = 0;
test_name[strlen(test_name) - 1] = 0;
sprintf(test_name, "%s)", test_name);
strncpy(&test_name[strlen(test_name) - 1], ")", 1);
if (nparams == 0) {
test_name[strlen(test_name) - 1] = 0;
}
Expand Down

0 comments on commit 625b23e

Please sign in to comment.