summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/context/cdlist_black.h11
-rw-r--r--test/unit/memory.h12
2 files changed, 22 insertions, 1 deletions
diff --git a/test/unit/context/cdlist_black.h b/test/unit/context/cdlist_black.h
index 299e11dee..aa25ba9eb 100644
--- a/test/unit/context/cdlist_black.h
+++ b/test/unit/context/cdlist_black.h
@@ -133,9 +133,16 @@ public:
TS_ASSERT_EQUALS(aThirdFalse, false);
}
+ /* setrlimit() totally broken on Mac OS X */
void testOutOfMemory() {
+#ifdef __APPLE__
+
+ TS_WARN("can't run memory tests on Mac OS X");
+
+#else /* __APPLE__ */
+
CDList<unsigned> list(d_context);
- WithLimitedMemory wlm(0);
+ WithLimitedMemory wlm(1);
TS_ASSERT_THROWS({
// We cap it at UINT_MAX, preferring to terminate with a
@@ -144,5 +151,7 @@ public:
list.push_back(i);
}
}, bad_alloc);
+
+#endif /* __APPLE__ */
}
};
diff --git a/test/unit/memory.h b/test/unit/memory.h
index 64b1da51b..6da3c08b5 100644
--- a/test/unit/memory.h
+++ b/test/unit/memory.h
@@ -31,6 +31,8 @@
#include <sys/time.h>
#include <sys/resource.h>
+#include "util/Assert.h"
+
namespace CVC4 {
namespace test {
@@ -46,10 +48,20 @@ class WithLimitedMemory {
public:
WithLimitedMemory() {
+#ifdef __APPLE__
+ TS_FAIL("setrlimit() is broken on Mac, can't run memory tests.");
+ AlwaysAssert(false,
+ "setrlimit() is broken on Mac, can't run memory tests.");
+#endif /* __APPLE__ */
remember();
}
WithLimitedMemory(rlim_t amount) {
+#ifdef __APPLE__
+ TS_FAIL("setrlimit() is broken on Mac, can't run memory tests.");
+ AlwaysAssert(false,
+ "setrlimit() is broken on Mac, can't run memory tests.");
+#endif /* __APPLE__ */
remember();
set(amount);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback