|
|
65e934 |
From 3298a5520d5ac4ec331b0b3b7a2211d4d94172cf Mon Sep 17 00:00:00 2001
|
|
|
65e934 |
From: Wim Taymans <wtaymans@redhat.com>
|
|
|
65e934 |
Date: Wed, 12 Aug 2015 13:16:28 +0200
|
|
|
65e934 |
Subject: [PATCH] test-limits: improve test without target
|
|
|
65e934 |
|
|
|
65e934 |
When there is no target available, the unit test would fail with a
|
|
|
65e934 |
non-fatal error (because emulation would be done). The non-fatal error
|
|
|
65e934 |
would however not be overwritten by the real error when we exceed the
|
|
|
65e934 |
limits.
|
|
|
65e934 |
|
|
|
65e934 |
First relax the first compilation test to check for FATAL errors. Then
|
|
|
65e934 |
reset the program (and clear any non-fatal errors) before triggering
|
|
|
65e934 |
the next error.
|
|
|
65e934 |
---
|
|
|
65e934 |
testsuite/test-limits.c | 4 +++-
|
|
|
65e934 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
65e934 |
|
|
|
65e934 |
diff --git a/testsuite/test-limits.c b/testsuite/test-limits.c
|
|
|
65e934 |
index ed19d8a..0e43924 100644
|
|
|
65e934 |
--- a/testsuite/test-limits.c
|
|
|
65e934 |
+++ b/testsuite/test-limits.c
|
|
|
65e934 |
@@ -35,9 +35,11 @@ test_simple (int max, int (*adder) (OrcProgram *, int, const char *))
|
|
|
65e934 |
for (v = 0; v < max; v++)
|
|
|
65e934 |
(*adder) (p, 2, names + v);
|
|
|
65e934 |
result = orc_program_compile (p);
|
|
|
65e934 |
- if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL (result))
|
|
|
65e934 |
+ if (ORC_COMPILE_RESULT_IS_FATAL (result))
|
|
|
65e934 |
error = TRUE;
|
|
|
65e934 |
|
|
|
65e934 |
+ orc_program_reset (p);
|
|
|
65e934 |
+
|
|
|
65e934 |
/* Check we can not add one more */
|
|
|
65e934 |
(*adder) (p, 2, names + v);
|
|
|
65e934 |
result = orc_program_compile (p);
|
|
|
65e934 |
--
|
|
|
65e934 |
2.4.3
|
|
|
65e934 |
|