int main(int argc, char *argv[]) { START(argc, argv, "obj_constructor"); /* root doesn't count */ UT_COMPILE_ERROR_ON(POBJ_LAYOUT_TYPES_NUM(constr) != 2); int big = (argc == 3 && strcmp(argv[2], USE_BIG_ALLOC) == 0); size_t node_size; size_t next_off; if (big) { node_size = sizeof(struct node_big); next_off = offsetof(struct node_big, next); } else if (argc == 2) {
int main(int argc, char *argv[]) { START(argc, argv, "heap_interrupt"); UT_COMPILE_ERROR_ON(POBJ_LAYOUT_TYPES_NUM(heap_interrupt) != 0); if (argc != 4) UT_FATAL("usage: %s file [cmd: c/o] [scenario]", argv[0]); const char *path = argv[1]; PMEMobjpool *pop = NULL; int exists = argv[2][0] == 'o'; int scenario = atoi(argv[3]); if (!exists) { if ((pop = pmemobj_create(path, POBJ_LAYOUT_NAME(heap_interrupt), 0, S_IWUSR | S_IRUSR)) == NULL) { UT_FATAL("failed to create pool\n"); } scenarios[scenario].create(pop); /* if we get here, something is wrong with function mocking */ UT_ASSERT(0); } else { if ((pop = pmemobj_open(path, POBJ_LAYOUT_NAME(heap_interrupt))) == NULL) { UT_FATAL("failed to open pool\n"); } scenarios[scenario].verify(pop); } pmemobj_close(pop); DONE(NULL); }