mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 02:18:03 +02:00
[test] Sync with memfault headers.
Update the macros to reflect the current version of memfault.
This commit is contained in:
parent
de7270cb1e
commit
130ac1f945
1 changed files with 21 additions and 21 deletions
|
|
@ -128,7 +128,7 @@ _cairo_test_init (cairo_test_context_t *ctx,
|
|||
{
|
||||
char *log_name;
|
||||
|
||||
MF (VALGRIND_DISABLE_FAULTS ());
|
||||
MF (MEMFAULT_DISABLE_FAULTS ());
|
||||
|
||||
#if HAVE_FEENABLEEXCEPT
|
||||
feenableexcept (FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
|
||||
|
|
@ -191,7 +191,7 @@ cairo_test_init_thread (cairo_test_context_t *ctx,
|
|||
cairo_test_context_t *master,
|
||||
int thread)
|
||||
{
|
||||
MF (VALGRIND_DISABLE_FAULTS ());
|
||||
MF (MEMFAULT_DISABLE_FAULTS ());
|
||||
|
||||
*ctx = *master;
|
||||
ctx->thread = thread;
|
||||
|
|
@ -631,11 +631,11 @@ cairo_test_for_target (cairo_test_context_t *ctx,
|
|||
|
||||
REPEAT:
|
||||
#if HAVE_MEMFAULT
|
||||
VALGRIND_CLEAR_FAULTS ();
|
||||
VALGRIND_RESET_LEAKS ();
|
||||
MEMFAULT_CLEAR_FAULTS ();
|
||||
MEMFAULT_RESET_LEAKS ();
|
||||
ctx->last_fault_count = 0;
|
||||
last_fault_count = VALGRIND_COUNT_FAULTS ();
|
||||
VALGRIND_ENABLE_FAULTS ();
|
||||
last_fault_count = MEMFAULT_COUNT_FAULTS ();
|
||||
MEMFAULT_ENABLE_FAULTS ();
|
||||
#endif
|
||||
have_output = FALSE;
|
||||
have_result = FALSE;
|
||||
|
|
@ -660,7 +660,7 @@ REPEAT:
|
|||
goto REPEAT;
|
||||
|
||||
if (cairo_surface_status (surface)) {
|
||||
MF (VALGRIND_PRINT_FAULTS ());
|
||||
MF (MEMFAULT_PRINT_FAULTS ());
|
||||
cairo_test_log (ctx, "Error: Created an error surface\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
goto UNWIND_STRINGS;
|
||||
|
|
@ -668,7 +668,7 @@ REPEAT:
|
|||
|
||||
/* Check that we created a surface of the expected type. */
|
||||
if (cairo_surface_get_type (surface) != target->expected_type) {
|
||||
MF (VALGRIND_PRINT_FAULTS ());
|
||||
MF (MEMFAULT_PRINT_FAULTS ());
|
||||
cairo_test_log (ctx, "Error: Created surface is of type %d (expected %d)\n",
|
||||
cairo_surface_get_type (surface), target->expected_type);
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
|
@ -681,7 +681,7 @@ REPEAT:
|
|||
expected_content = cairo_boilerplate_content (target->content);
|
||||
|
||||
if (cairo_surface_get_content (surface) != expected_content) {
|
||||
MF (VALGRIND_PRINT_FAULTS ());
|
||||
MF (MEMFAULT_PRINT_FAULTS ());
|
||||
cairo_test_log (ctx, "Error: Created surface has content %d (expected %d)\n",
|
||||
cairo_surface_get_content (surface), expected_content);
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
|
@ -736,11 +736,11 @@ REPEAT:
|
|||
}
|
||||
|
||||
#if HAVE_MEMFAULT
|
||||
VALGRIND_DISABLE_FAULTS ();
|
||||
MEMFAULT_DISABLE_FAULTS ();
|
||||
|
||||
/* repeat test after malloc failure injection */
|
||||
if (ctx->malloc_failure &&
|
||||
VALGRIND_COUNT_FAULTS () - last_fault_count > 0 &&
|
||||
MEMFAULT_COUNT_FAULTS () - last_fault_count > 0 &&
|
||||
(status == CAIRO_TEST_NO_MEMORY ||
|
||||
cairo_status (cr) == CAIRO_STATUS_NO_MEMORY ||
|
||||
cairo_surface_status (surface) == CAIRO_STATUS_NO_MEMORY))
|
||||
|
|
@ -754,9 +754,9 @@ REPEAT:
|
|||
#if HAVE_FCFINI
|
||||
FcFini ();
|
||||
#endif
|
||||
if (VALGRIND_COUNT_LEAKS () > 0) {
|
||||
VALGRIND_PRINT_FAULTS ();
|
||||
VALGRIND_PRINT_LEAKS ();
|
||||
if (MEMFAULT_COUNT_LEAKS () > 0) {
|
||||
MEMFAULT_PRINT_FAULTS ();
|
||||
MEMFAULT_PRINT_LEAKS ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -779,9 +779,9 @@ REPEAT:
|
|||
}
|
||||
|
||||
#if HAVE_MEMFAULT
|
||||
if (VALGRIND_COUNT_FAULTS () - last_fault_count > 0) {
|
||||
if (MEMFAULT_COUNT_FAULTS () - last_fault_count > 0) {
|
||||
VALGRIND_PRINTF ("Unreported memfaults...");
|
||||
VALGRIND_PRINT_FAULTS ();
|
||||
MEMFAULT_PRINT_FAULTS ();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -983,7 +983,7 @@ UNWIND_CAIRO:
|
|||
|
||||
#if HAVE_MEMFAULT
|
||||
if (ret == CAIRO_TEST_FAILURE && ctx->expectation != CAIRO_TEST_FAILURE)
|
||||
VALGRIND_PRINT_FAULTS ();
|
||||
MEMFAULT_PRINT_FAULTS ();
|
||||
#endif
|
||||
cairo_destroy (cr);
|
||||
UNWIND_SURFACE:
|
||||
|
|
@ -1000,13 +1000,13 @@ UNWIND_SURFACE:
|
|||
FcFini ();
|
||||
#endif
|
||||
|
||||
if (VALGRIND_COUNT_LEAKS () > 0) {
|
||||
if (MEMFAULT_COUNT_LEAKS () > 0) {
|
||||
if (ret != CAIRO_TEST_FAILURE ||
|
||||
ctx->expectation == CAIRO_TEST_FAILURE)
|
||||
{
|
||||
VALGRIND_PRINT_FAULTS ();
|
||||
MEMFAULT_PRINT_FAULTS ();
|
||||
}
|
||||
VALGRIND_PRINT_LEAKS ();
|
||||
MEMFAULT_PRINT_LEAKS ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1481,7 +1481,7 @@ cairo_test_malloc_failure (const cairo_test_context_t *ctx,
|
|||
|
||||
#if HAVE_MEMFAULT
|
||||
/* prevent infinite loops... */
|
||||
n_faults = VALGRIND_COUNT_FAULTS ();
|
||||
n_faults = MEMFAULT_COUNT_FAULTS ();
|
||||
if (n_faults == ctx->last_fault_count)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue