Skip to content

Commit

Permalink
Merge pull request pmem#3004 from Greg091/test-pmemobj-oid
Browse files Browse the repository at this point in the history
 test: add tests for pmemobj_oid
  • Loading branch information
marcinslusarz authored Jun 21, 2018
2 parents 78eac37 + 40b715b commit a18b93e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/test/obj_oid_thread/obj_oid_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test_worker(void *arg)
int
main(int argc, char *argv[])
{
START(argc, argv, "obj_oid");
START(argc, argv, "obj_oid_thread");

if (argc != 3)
UT_FATAL("usage: %s [directory] [# of pools]", argv[0]);
Expand Down Expand Up @@ -103,6 +103,10 @@ main(int argc, char *argv[])
UT_FATAL("!pmemobj_create");
}

/* Address outside the pmemobj pool */
void *allocated_memory = MALLOC(sizeof(int));
UT_ASSERT(OID_IS_NULL(pmemobj_oid(allocated_memory)));

PMEMoid *oids = MALLOC(npools * sizeof(PMEMoid));
PMEMoid *tmpoids = MALLOC(npools * sizeof(PMEMoid));

Expand Down Expand Up @@ -155,6 +159,7 @@ main(int argc, char *argv[])
FREE(tmpoids);
FREE(oids);
FREE(pops);
FREE(allocated_memory);

os_mutex_destroy(&lock);
os_cond_destroy(&cond);
Expand Down
2 changes: 1 addition & 1 deletion src/test/obj_oid_thread/obj_oid_thread.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{8C6D73E0-0A6F-4487-A040-0EC78D7D6D9A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>obj_oid</RootNamespace>
<RootNamespace>obj_oid_thread</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<ProjectName>obj_oid_thread</ProjectName>
</PropertyGroup>
Expand Down

0 comments on commit a18b93e

Please sign in to comment.