aboutsummaryrefslogtreecommitdiff
path: root/plugins/huawei/tests
diff options
context:
space:
mode:
authorYunlian Jiang <yunlian@google.com>2015-03-27 20:30:18 +0100
committerAleksander Morgado <aleksander@aleksander.es>2015-03-27 20:31:24 +0100
commit977cf658a6bf92a764632f69e99fe39a39e0ee4d (patch)
tree52e9a40160d874ba96a1e25ccbe6708485ff66a6 /plugins/huawei/tests
parent948be2343a592d35403a8e7319fbe21952e56256 (diff)
tests: fix memory leaks
Diffstat (limited to 'plugins/huawei/tests')
-rw-r--r--plugins/huawei/tests/test-modem-helpers-huawei.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/huawei/tests/test-modem-helpers-huawei.c b/plugins/huawei/tests/test-modem-helpers-huawei.c
index 9e92eee2..ffc0854e 100644
--- a/plugins/huawei/tests/test-modem-helpers-huawei.c
+++ b/plugins/huawei/tests/test-modem-helpers-huawei.c
@@ -420,6 +420,7 @@ test_prefmode_response (void)
found = mm_huawei_parse_prefmode_response (prefmode_response_tests[i].str,
combinations,
&error);
+ g_assert_no_error (error);
g_assert (found != NULL);
g_assert_cmpuint (found->allowed, ==, prefmode_response_tests[i].allowed);
g_assert_cmpuint (found->preferred, ==, prefmode_response_tests[i].preferred);
@@ -672,6 +673,7 @@ test_syscfg_response (void)
combinations,
&error);
+ g_assert_no_error (error);
g_assert (found != NULL);
g_assert_cmpuint (found->allowed, ==, syscfg_response_tests[i].allowed);
g_assert_cmpuint (found->preferred, ==, syscfg_response_tests[i].preferred);
@@ -993,6 +995,7 @@ test_syscfgex_response (void)
combinations,
&error);
+ g_assert_no_error (error);
g_assert (found != NULL);
g_assert_cmpuint (found->allowed, ==, syscfgex_response_tests[i].allowed);
g_assert_cmpuint (found->preferred, ==, syscfgex_response_tests[i].preferred);
@@ -1085,8 +1088,10 @@ test_nwtime (void)
g_assert (nwtime_tests[i].leap_seconds == mm_network_timezone_get_leap_seconds (tz));
}
- if (iso8601)
- g_free (iso8601);
+ g_free (iso8601);
+
+ if (tz)
+ g_object_unref (tz);
}
}
@@ -1125,11 +1130,10 @@ test_time (void)
g_assert (ret == time_tests[i].ret);
g_assert (ret == (error ? FALSE : TRUE));
+ g_clear_error (&error);
g_assert_cmpstr (time_tests[i].iso8601, ==, iso8601);
-
- if (iso8601)
- g_free (iso8601);
+ g_free (iso8601);
}
}