forked from github/server
memory leak: free params after test
This commit is contained in:
parent
20c9fb60dc
commit
3cfb22876b
1 changed files with 3 additions and 0 deletions
|
@ -132,6 +132,7 @@ static void test_get_set_param(CuTest * tc)
|
||||||
CuAssertStrEquals(tc, "foo", get_param(par, "bar"));
|
CuAssertStrEquals(tc, "foo", get_param(par, "bar"));
|
||||||
set_param(&par, "bar", NULL);
|
set_param(&par, "bar", NULL);
|
||||||
CuAssertPtrEquals(tc, NULL, (void *)get_param(par, "bar"));
|
CuAssertPtrEquals(tc, NULL, (void *)get_param(par, "bar"));
|
||||||
|
free_params(&par);
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +145,7 @@ static void test_param_int(CuTest * tc)
|
||||||
set_param(&par, "bar", "42");
|
set_param(&par, "bar", "42");
|
||||||
CuAssertIntEquals(tc, 23, get_param_int(par, "foo", 0));
|
CuAssertIntEquals(tc, 23, get_param_int(par, "foo", 0));
|
||||||
CuAssertIntEquals(tc, 42, get_param_int(par, "bar", 0));
|
CuAssertIntEquals(tc, 42, get_param_int(par, "bar", 0));
|
||||||
|
free_params(&par);
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +158,7 @@ static void test_param_flt(CuTest * tc)
|
||||||
set_param(&par, "bar", "42.0");
|
set_param(&par, "bar", "42.0");
|
||||||
CuAssertDblEquals(tc, 23.0, get_param_flt(par, "foo", 0.0), 0.01);
|
CuAssertDblEquals(tc, 23.0, get_param_flt(par, "foo", 0.0), 0.01);
|
||||||
CuAssertDblEquals(tc, 42.0, get_param_flt(par, "bar", 0.0), 0.01);
|
CuAssertDblEquals(tc, 42.0, get_param_flt(par, "bar", 0.0), 0.01);
|
||||||
|
free_params(&par);
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue