* @param func a valid function name that will be used to contain all code of this unit
* @param title human informative description of your test (displayed in testall)
*/
+#ifdef __cplusplus
+#define XBT_TEST_UNIT(name,func,title) \
+ extern "C" void func(void); /*prototype*/ \
+ void func(void)
+#else
#define XBT_TEST_UNIT(name,func,title) \
void func(void); /*prototype*/ \
void func(void)
-
+#endif
/* test operations */
XBT_PUBLIC(void) _xbt_test_add(const char *file, int line, const char *fmt,
return mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
}
-extern "C" {
-
XBT_TEST_SUITE("mc_page_store", "Page store");
XBT_TEST_UNIT("base", test_mc_page_store, "Test adding/removing pages in the store")
xbt_test_assert(store->size()==2, "Bad size");
}
-}
-
#endif /* SIMGRID_TEST */
}
}
}
+}
+
#ifdef SIMGRID_TEST
#include <string.h>
#include "src/mc/mc_snapshot.h"
#include "src/mc/mc_mmu.h"
-extern "C" {
-
XBT_TEST_SUITE("mc_snapshot", "Snapshots");
static inline void init_memory(void* mem, size_t size)
mc_model_checker = NULL;
}
-}
-
#endif /* SIMGRID_TEST */
-}