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: unify ut names #155

Merged
merged 1 commit into from
Jul 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/cmocka/src/audio/component/comp_set_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ struct test_case {

#define TEST_CASE(type, in_state, cmd, out_state) \
{(type), (in_state), (cmd), (out_state), \
("comp_set_state__" #type "__" #in_state "__" #cmd "__" #out_state)}
("test_audio_component_comp_set_state__" \
#type "__" #in_state "__" #cmd "__" #out_state)}


/*
Expand Down Expand Up @@ -213,7 +214,7 @@ static void test_audio_component_comp_set_state_fail(struct test_case *tc)
assert_int_equal(comp_set_state(&test_drv, tc->cmd), -EINVAL);
}

static void test_comp_set_state(void **state)
static void test_audio_component_comp_set_state(void **state)
{
struct test_case *tc = *((struct test_case **) state);

Expand All @@ -240,7 +241,7 @@ int main(void)
struct CMUnitTest *t = &tests[i];

t->name = test_cases[i].name;
t->test_func = test_comp_set_state;
t->test_func = test_audio_component_comp_set_state;
t->initial_state = &test_cases[i];
t->setup_func = NULL;
t->teardown_func = NULL;
Expand Down
2 changes: 1 addition & 1 deletion test/cmocka/src/audio/mixer/mixer_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct mix_test_case {
{ \
.num_sources = (_num_sources), \
.num_chans = (_num_chans), \
.name = ("mixer_copy_" \
.name = ("test_audio_mixer_copy_" \
#_num_sources "_srcs_" \
#_num_chans "ch"), \
.sources = NULL \
Expand Down
6 changes: 3 additions & 3 deletions test/cmocka/src/audio/volume/volume_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static void verify_s32_to_s24_s32(struct comp_dev *dev,
}
}

static void test_vol(void **state)
static void test_audio_vol(void **state)
{
struct vol_test_state *vol_state = *state;
struct comp_data *cd = comp_get_drvdata(vol_state->dev);
Expand Down Expand Up @@ -340,8 +340,8 @@ int main(void)
struct CMUnitTest tests[ARRAY_SIZE(parameters)];

for (i = 0; i < ARRAY_SIZE(parameters); i++) {
tests[i].name = "test_vol";
tests[i].test_func = test_vol;
tests[i].name = "test_audio_vol";
tests[i].test_func = test_audio_vol;
tests[i].setup_func = setup;
tests[i].teardown_func = teardown;
tests[i].initial_state = &parameters[i];
Expand Down
18 changes: 9 additions & 9 deletions test/cmocka/src/lib/alloc/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct test_case {

#define TEST_CASE(bytes, zone, caps, num, type, name_base) \
{(bytes), (zone), (caps), (num), (type), \
(name_base "__" #zone "__" #bytes "x" #num)}
("test_lib_alloc_" name_base "__" #zone "__" #bytes "x" #num)}

static struct test_case test_cases[] = {
/*
Expand Down Expand Up @@ -236,7 +236,7 @@ static void *alloc(struct test_case *tc)
return mem;
}

static void test_alloc_bulk_free(struct test_case *tc)
static void test_lib_alloc_bulk_free(struct test_case *tc)
{
void **all_mem = malloc(sizeof(void *) * tc->alloc_num);
int i;
Expand All @@ -254,7 +254,7 @@ static void test_alloc_bulk_free(struct test_case *tc)
rfree(all_mem);
}

static void test_alloc_immediate_free(struct test_case *tc)
static void test_lib_alloc_immediate_free(struct test_case *tc)
{
int i;

Expand All @@ -266,7 +266,7 @@ static void test_alloc_immediate_free(struct test_case *tc)
}
}

static void test_alloc_zero(struct test_case *tc)
static void test_lib_alloc_zero(struct test_case *tc)
{
void **all_mem = malloc(sizeof(void *) * tc->alloc_num);
int i;
Expand All @@ -289,21 +289,21 @@ static void test_alloc_zero(struct test_case *tc)
rfree(all_mem);
}

static void test_alloc(void **state)
static void test_lib_alloc(void **state)
{
struct test_case *tc = *((struct test_case **)state);

switch (tc->type) {
case TEST_BULK:
test_alloc_bulk_free(tc);
test_lib_alloc_bulk_free(tc);
break;

case TEST_ZERO:
test_alloc_zero(tc);
test_lib_alloc_zero(tc);
break;

case TEST_IMMEDIATE_FREE:
test_alloc_immediate_free(tc);
test_lib_alloc_immediate_free(tc);
break;
}
}
Expand All @@ -318,7 +318,7 @@ int main(void)
struct CMUnitTest *t = &tests[i];

t->name = test_cases[i].name;
t->test_func = test_alloc;
t->test_func = test_lib_alloc;
t->initial_state = &test_cases[i];
t->setup_func = NULL;
t->teardown_func = NULL;
Expand Down