tests: Improve branch coverage when testing g_time_val_add()

While I’m here…

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2018-08-07 11:00:16 +01:00
parent 725eb1c86b
commit 6104e63ec4

View File

@ -115,6 +115,14 @@ test_timeval_add (void)
g_time_val_add (&time, 1000);
g_assert_cmpint (time.tv_sec, ==, 1);
g_assert_cmpint (time.tv_usec, ==, 510);
g_time_val_add (&time, 0);
g_assert_cmpint (time.tv_sec, ==, 1);
g_assert_cmpint (time.tv_usec, ==, 510);
g_time_val_add (&time, -210);
g_assert_cmpint (time.tv_sec, ==, 1);
g_assert_cmpint (time.tv_usec, ==, 300);
}
typedef struct {