summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-10-22 11:43:45 +0100
committerTom Hacohen <tom@stosb.com>2014-10-22 11:43:45 +0100
commite1c0928ea377bcb6886335a8d4eeb1b581f67a17 (patch)
tree87730723b47f8cf97e8f8190a2917725cf48b2d3
parent0b86334a858d9ba88a1642ec5671185292e75ce5 (diff)
downloadefl-e1c0928ea377bcb6886335a8d4eeb1b581f67a17.tar.gz
Eo id: Add regression tests to eo id sanity checks
Relevant commit: 0b86334a858d9ba88a1642ec5671185292e75ce5
-rw-r--r--src/tests/eo/suite/eo_test_general.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 18b1a00df0..feef06a31a 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -8,6 +8,9 @@
#include "eo_suite.h"
#include "eo_test_class_simple.h"
+/* Loading this internal header for testing purposes. */
+#include "eo_ptr_indirection.h"
+
START_TEST(eo_simple)
{
eo_init();
@@ -848,6 +851,13 @@ START_TEST(eo_pointers_indirection)
fail_if(eo_isa(obj1, klass));
eo_unref(obj2);
+ /* Check id sanity checks for "close enough" ids. */
+ obj1 = eo_add(klass, NULL);
+ fail_if(!obj1);
+ obj2 = (Eo *) (((Eo_Id) obj1) & ~MASK_OBJ_TAG);
+ fail_if(eo_class_get(obj2));
+ eo_unref(obj1);
+
#define NB_OBJS 10000
unsigned int obj_id;
Eo **objs = calloc(NB_OBJS, sizeof(Eo *));