mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-03 11:20:27 +01:00
[test] Propagate allocation failure.
Check for memfaults during rel-path test.
This commit is contained in:
parent
7db55b37d4
commit
c932a809d6
1 changed files with 16 additions and 3 deletions
|
|
@ -74,24 +74,37 @@ draw (cairo_t *cr, int width, int height)
|
|||
{
|
||||
const cairo_test_context_t *ctx = cairo_test_get_context (cr);
|
||||
cairo_status_t status;
|
||||
cairo_test_status_t result;
|
||||
|
||||
/* first test that a relative move without a current point fails... */
|
||||
status = invalid_rel_move_to (cairo_get_target (cr));
|
||||
if (status != CAIRO_STATUS_NO_CURRENT_POINT) {
|
||||
result = cairo_test_status_from_status (ctx, status);
|
||||
if (result == CAIRO_TEST_NO_MEMORY)
|
||||
return result;
|
||||
|
||||
cairo_test_log (ctx, "Error: invalid cairo_rel_move_to() did not raise NO_CURRENT_POINT\n");
|
||||
return CAIRO_TEST_FAILURE;
|
||||
return result;
|
||||
}
|
||||
|
||||
status = invalid_rel_line_to (cairo_get_target (cr));
|
||||
if (status != CAIRO_STATUS_NO_CURRENT_POINT) {
|
||||
result = cairo_test_status_from_status (ctx, status);
|
||||
if (result == CAIRO_TEST_NO_MEMORY)
|
||||
return result;
|
||||
|
||||
cairo_test_log (ctx, "Error: invalid cairo_rel_line_to() did not raise NO_CURRENT_POINT\n");
|
||||
return CAIRO_TEST_FAILURE;
|
||||
return result;
|
||||
}
|
||||
|
||||
status = invalid_rel_curve_to (cairo_get_target (cr));
|
||||
if (status != CAIRO_STATUS_NO_CURRENT_POINT) {
|
||||
result = cairo_test_status_from_status (ctx, status);
|
||||
if (result == CAIRO_TEST_NO_MEMORY)
|
||||
return result;
|
||||
|
||||
cairo_test_log (ctx, "Error: invalid cairo_rel_curve_to() did not raise NO_CURRENT_POINT\n");
|
||||
return CAIRO_TEST_FAILURE;
|
||||
return result;
|
||||
}
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue