gtestutils: Add a new g_assert_no_errno() test macro

This is for use in testing POSIX-style functions like `rmdir()`, which
return an integer < 0 on failure, and return their error information in
`errno`.

The new macro prints `errno` and `g_strerror (errno)` on failure.

Includes a unit test.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall
2019-10-31 11:22:16 +00:00
parent 2510d5aae0
commit 9e45b95816
4 changed files with 61 additions and 0 deletions

View File

@@ -3459,6 +3459,7 @@ g_assert_true
g_assert_false
g_assert_null
g_assert_nonnull
g_assert_no_errno
g_test_set_nonfatal_assertions
GTestCase