tests: Add an assertion to avoid a scan-build warning

This should avoid the warning:
```
../../../glib/tests/mainloop.c:119:3: warning: Value stored to 'id' is never read
  id = g_source_attach (source, ctx);
  ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2020-10-14 13:06:34 +01:00
parent 2e7d3dcf70
commit 12f8708928

View File

@ -121,6 +121,7 @@ test_maincontext_basic (void)
g_source_set_funcs (source, &funcs);
g_source_set_callback (source, cb, data, NULL);
id = g_source_attach (source, ctx);
g_assert_cmpint (id, >, 0);
g_source_unref (source);
g_assert_true (g_source_remove_by_user_data (data));
g_assert_false (g_source_remove_by_user_data ((gpointer)0x1234));