summaryrefslogtreecommitdiff
path: root/glib/gtestutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'glib/gtestutils.h')
-rw-r--r--glib/gtestutils.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/glib/gtestutils.h b/glib/gtestutils.h
index 3369f5fc6..86ee4e521 100644
--- a/glib/gtestutils.h
+++ b/glib/gtestutils.h
@@ -82,7 +82,7 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
} G_STMT_END
#define g_assert_cmpmem(m1, l1, m2, l2) G_STMT_START {\
gconstpointer __m1 = m1, __m2 = m2; \
- int __l1 = l1, __l2 = l2; \
+ size_t __l1 = (size_t) l1, __l2 = (size_t) l2; \
if (__l1 != 0 && __m1 == NULL) \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
"assertion failed (" #l1 " == 0 || " #m1 " != NULL)"); \
@@ -195,7 +195,7 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
} G_STMT_END
/* Use nullptr in C++ to catch misuse of these macros. */
-#if defined(__cplusplus) && __cplusplus >= 201100L
+#if G_CXX_STD_CHECK_VERSION (11)
#define g_assert_null(expr) G_STMT_START { if G_LIKELY ((expr) == nullptr) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
"'" #expr "' should be nullptr"); \
@@ -426,6 +426,7 @@ void g_test_queue_destroy (GDestroyNotify destroy_func,
/**
* GTestTrapFlags:
+ * @G_TEST_TRAP_DEFAULT: Default behaviour. Since: 2.74
* @G_TEST_TRAP_SILENCE_STDOUT: Redirect stdout of the test child to
* `/dev/null` so it cannot be observed on the console during test
* runs. The actual output is still captured though to allow later
@@ -446,6 +447,7 @@ void g_test_queue_destroy (GDestroyNotify destroy_func,
* #GTestSubprocessFlags.
*/
typedef enum {
+ G_TEST_TRAP_DEFAULT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
G_TEST_TRAP_SILENCE_STDOUT = 1 << 7,
G_TEST_TRAP_SILENCE_STDERR = 1 << 8,
G_TEST_TRAP_INHERIT_STDIN = 1 << 9
@@ -460,6 +462,7 @@ gboolean g_test_trap_fork (guint64 usec_timeout,
G_GNUC_END_IGNORE_DEPRECATIONS
typedef enum {
+ G_TEST_SUBPROCESS_DEFAULT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
G_TEST_SUBPROCESS_INHERIT_STDIN = 1 << 0,
G_TEST_SUBPROCESS_INHERIT_STDOUT = 1 << 1,
G_TEST_SUBPROCESS_INHERIT_STDERR = 1 << 2
@@ -538,8 +541,8 @@ void g_assertion_message (const char *domain,
int line,
const char *func,
const char *message) G_ANALYZER_NORETURN;
-GLIB_AVAILABLE_IN_ALL
G_NORETURN
+GLIB_AVAILABLE_IN_ALL
void g_assertion_message_expr (const char *domain,
const char *file,
int line,