summaryrefslogtreecommitdiff
path: root/test/cairo-test.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-05-15 16:57:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-05-15 21:31:03 +0100
commit791a6fa399894e735d522781b15b7f18c3ecd4d1 (patch)
tree34370a6010fab200b4acc93781f3f1cb2dc96753 /test/cairo-test.c
parentc897f36a6b09f3591d858142e3236f256f0bd6a2 (diff)
[memfault] Update macros to avoid namescape collision with memcheck
Basing the macro names of the memfault skin lead to a namespace collision with memcheck. After updating the headers, update cairo's usage to match.
Diffstat (limited to 'test/cairo-test.c')
-rw-r--r--test/cairo-test.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 96ab2dcd..4e3d2fb3 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -131,7 +131,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);
@@ -222,7 +222,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;
@@ -739,17 +739,17 @@ cairo_test_for_target (cairo_test_context_t *ctx,
#if HAVE_MEMFAULT
REPEAT:
- VALGRIND_CLEAR_FAULTS ();
- VALGRIND_RESET_LEAKS ();
+ MEMFAULT_CLEAR_FAULTS ();
+ MEMFAULT_RESET_LEAKS ();
ctx->last_fault_count = 0;
- last_fault_count = VALGRIND_COUNT_FAULTS ();
+ last_fault_count = MEMFAULT_COUNT_FAULTS ();
/* Pre-initialise fontconfig so that the configuration is loaded without
* malloc failures (our primary goal is to test cairo fault tolerance).
*/
FcInit ();
- VALGRIND_ENABLE_FAULTS ();
+ MEMFAULT_ENABLE_FAULTS ();
#endif
have_output = FALSE;
have_result = FALSE;
@@ -772,7 +772,7 @@ REPEAT:
#if HAVE_MEMFAULT
if (ctx->malloc_failure &&
- VALGRIND_COUNT_FAULTS () - last_fault_count > 0 &&
+ MEMFAULT_COUNT_FAULTS () - last_fault_count > 0 &&
cairo_surface_status (surface) == CAIRO_STATUS_NO_MEMORY)
{
goto REPEAT;
@@ -780,7 +780,7 @@ REPEAT:
#endif
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;
@@ -788,7 +788,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;
@@ -801,7 +801,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;
@@ -856,11 +856,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))
@@ -874,9 +874,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 ();
}
}
@@ -899,11 +899,11 @@ REPEAT:
}
#if HAVE_MEMFAULT
- if (VALGRIND_COUNT_FAULTS () - last_fault_count > 0 &&
- VALGRIND_HAS_FAULTS ())
+ if (MEMFAULT_COUNT_FAULTS () - last_fault_count > 0 &&
+ MEMFAULT_HAS_FAULTS ())
{
VALGRIND_PRINTF ("Unreported memfaults...");
- VALGRIND_PRINT_FAULTS ();
+ MEMFAULT_PRINT_FAULTS ();
}
#endif
@@ -920,18 +920,18 @@ REPEAT:
/* We need to re-enable faults as most meta-surface processing
* is done during cairo_surface_finish().
*/
- VALGRIND_CLEAR_FAULTS ();
- last_fault_count = VALGRIND_COUNT_FAULTS ();
- VALGRIND_ENABLE_FAULTS ();
+ MEMFAULT_CLEAR_FAULTS ();
+ last_fault_count = MEMFAULT_COUNT_FAULTS ();
+ MEMFAULT_ENABLE_FAULTS ();
#endif
diff_status = target->finish_surface (surface);
#if HAVE_MEMFAULT
- VALGRIND_DISABLE_FAULTS ();
+ MEMFAULT_DISABLE_FAULTS ();
if (ctx->malloc_failure &&
- VALGRIND_COUNT_FAULTS () - last_fault_count > 0 &&
+ MEMFAULT_COUNT_FAULTS () - last_fault_count > 0 &&
diff_status == CAIRO_STATUS_NO_MEMORY)
{
cairo_destroy (cr);
@@ -943,9 +943,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 ();
}
}
@@ -1135,7 +1135,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:
@@ -1152,13 +1152,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 ();
}
}
@@ -1648,7 +1648,7 @@ cairo_test_malloc_failure (const cairo_test_context_t *ctx,
int n_faults;
/* prevent infinite loops... */
- n_faults = VALGRIND_COUNT_FAULTS ();
+ n_faults = MEMFAULT_COUNT_FAULTS ();
if (n_faults == ctx->last_fault_count)
return FALSE;