static void * do_test(void *arg) { int ver = *(int *)arg; pmem_check_version(ver, 0); pmemobj_check_version(ver, 0); pmemlog_check_version(ver, 0); pmemblk_check_version(ver, 0); vmem_check_version(ver, 0); pmempool_check_version(ver, 0); check_errors(ver); return NULL; }
int main(int argc, char *argv[]) { START(argc, argv, "traces_pmem"); ASSERT(!pmem_check_version(PMEM_MAJOR_VERSION, PMEM_MINOR_VERSION)); ASSERT(!pmemblk_check_version(PMEMBLK_MAJOR_VERSION, PMEMBLK_MINOR_VERSION)); ASSERT(!pmemlog_check_version(PMEMLOG_MAJOR_VERSION, PMEMLOG_MINOR_VERSION)); ASSERT(!pmemobj_check_version(PMEMOBJ_MAJOR_VERSION, PMEMOBJ_MINOR_VERSION)); DONE(NULL); }
static void * do_test(void *arg) { int ver = *(int *)arg; pmem_check_version(ver, 0); pmemobj_check_version(ver, 0); pmemlog_check_version(ver, 0); pmemblk_check_version(ver, 0); #ifndef _WIN32 /* XXX - vmem not implemented in windows yet */ vmem_check_version(ver, 0); #endif pmempool_check_version(ver, 0); check_errors(ver); return NULL; }
int main(int argc, char *argv[]) { START(argc, argv, "out_err_mt"); if (argc != 5) UT_FATAL("usage: %s filename1 filename2 filename3 dir", argv[0]); PMEMobjpool *pop = pmemobj_create(argv[1], "test", PMEMOBJ_MIN_POOL, 0666); PMEMlogpool *plp = pmemlog_create(argv[2], PMEMLOG_MIN_POOL, 0666); PMEMblkpool *pbp = pmemblk_create(argv[3], 128, PMEMBLK_MIN_POOL, 0666); #ifndef _WIN32 /* XXX - vmem not implemented in windows yet */ VMEM *vmp = vmem_create(argv[4], VMEM_MIN_POOL); #endif util_init(); pmem_check_version(10000, 0); pmemobj_check_version(10001, 0); pmemlog_check_version(10002, 0); pmemblk_check_version(10003, 0); #ifndef _WIN32 /* XXX - vmem not implemented in windows yet */ vmem_check_version(10004, 0); #endif pmempool_check_version(10005, 0); print_errors("version check"); void *ptr = NULL; /* * We are testing library error reporting and we don't want this test * to fail under memcheck. */ VALGRIND_DO_DISABLE_ERROR_REPORTING; pmem_msync(ptr, 1); VALGRIND_DO_ENABLE_ERROR_REPORTING; print_errors("pmem_msync"); pmemlog_append(plp, NULL, PMEMLOG_MIN_POOL); print_errors("pmemlog_append"); size_t nblock = pmemblk_nblock(pbp); pmemblk_set_error(pbp, nblock + 1); print_errors("pmemblk_set_error"); #ifndef _WIN32 /* XXX - vmem not implemented in windows yet */ VMEM *vmp2 = vmem_create_in_region(NULL, 1); UT_ASSERTeq(vmp2, NULL); print_errors("vmem_create_in_region"); #endif run_mt_test(do_test); pmemobj_close(pop); pmemlog_close(plp); pmemblk_close(pbp); #ifndef _WIN32 /* XXX - vmem not implemented in windows yet */ vmem_delete(vmp); #endif PMEMpoolcheck *ppc; struct pmempool_check_args args = {0, }; ppc = pmempool_check_init(&args, sizeof(args) / 2); UT_ASSERTeq(ppc, NULL); print_errors("pmempool_check_init"); DONE(NULL); }