Skip to content
Snippets Groups Projects
Commit 8323f3a3 authored by Piotr Balcer's avatar Piotr Balcer
Browse files

obj: fix POBJ_LIST_* macros and enable integration test

parent bc7005ac
No related branches found
No related tags found
No related merge requests found
......@@ -384,86 +384,86 @@ for (OID_ASSIGN_TYPED((var), POBJ_LIST_LAST((head), field));\
#define POBJ_LIST_INSERT_HEAD(pop, head, elm, field)\
pmemobj_list_insert((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)), POBJ_LIST_FIRST((head)).oid,\
(head), POBJ_LIST_FIRST((head)).oid,\
1 /* before */, (elm).oid)
#define POBJ_LIST_INSERT_TAIL(pop, head, elm, field)\
pmemobj_list_insert((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)), POBJ_LIST_LAST((head), field).oid,\
(head), POBJ_LIST_LAST((head), field).oid,\
0 /* after */, (elm).oid)
#define POBJ_LIST_INSERT_AFTER(pop, head, listelm, elm, field)\
pmemobj_list_insert((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)), (listelm).oid,\
(head), (listelm).oid,\
0 /* after */, (elm).oid)
#define POBJ_LIST_INSERT_BEFORE(pop, head, listelm, elm, field)\
pmemobj_list_insert((pop), offsetof(typeof (*D_RO((elm))),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)), (listelm).oid,\
(head), (listelm).oid,\
1 /* before */, (elm).oid)
#define POBJ_LIST_INSERT_NEW_HEAD(pop, head, type_num, field)\
pmemobj_list_insert_new((pop),\
offsetof(typeof (*((head)->pe_first._type)), field),\
&POBJ_LIST_FIRST((head)), POBJ_LIST_FIRST((head)).oid,\
(head), POBJ_LIST_FIRST((head)).oid,\
1 /* before */, sizeof (*(POBJ_LIST_FIRST(head)._type)), type_num)
#define POBJ_LIST_INSERT_NEW_TAIL(pop, head, type_num, field)\
pmemobj_list_insert_new((pop),\
offsetof(typeof (*((head)->pe_first._type)), field),\
&POBJ_LIST_FIRST((head)), POBJ_LIST_LAST((head), field).oid,\
(head), POBJ_LIST_LAST((head), field).oid,\
0 /* after */, sizeof (*(POBJ_LIST_FIRST(head)._type)), type_num)
#define POBJ_LIST_INSERT_NEW_AFTER(pop, head, listelm, type_num, field)\
pmemobj_list_insert_new((pop),\
offsetof(typeof (*((head)->pe_first._type)), field),\
&POBJ_LIST_FIRST((head)), (listelm).oid, 0 /* after */,\
(head), (listelm).oid, 0 /* after */,\
sizeof (*(POBJ_LIST_FIRST(head)._type)), type_num)
#define POBJ_LIST_INSERT_NEW_BEFORE(pop, head, listelm, type_num, field)\
pmemobj_list_insert_new((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)), (listelm).oid, 1 /* before */,\
(head), (listelm).oid, 1 /* before */,\
sizeof (*(POBJ_LIST_FIRST(head)._type)), type_num)
#define POBJ_LIST_REMOVE(pop, head, elm, field)\
pmemobj_list_remove((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)), (elm).oid, 0 /* no free */)
(head), (elm).oid, 0 /* no free */)
#define POBJ_LIST_REMOVE_FREE(pop, head, elm, field)\
pmemobj_list_remove((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)), (elm).oid, 1 /* free */)
(head), (elm).oid, 1 /* free */)
#define POBJ_LIST_MOVE_ELEMENT_HEAD(pop, head, head_new, elm, field, field_new)\
pmemobj_list_move((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)),\
(head),\
offsetof(typeof (*(POBJ_LIST_FIRST(head_new)._type)), field_new),\
&POBJ_LIST_FIRST((head_new)),\
POBJ_LIST_FIRST((head)).oid,\
(head_new),\
POBJ_LIST_FIRST((head_new)).oid,\
1 /* before */, (elm).oid)
#define POBJ_LIST_MOVE_ELEMENT_TAIL(pop, head, head_new, elm, field, field_new)\
pmemobj_list_move((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)),\
(head),\
offsetof(typeof (*(POBJ_LIST_FIRST(head_new)._type)), field_new),\
&POBJ_LIST_FIRST((head_new)),\
POBJ_LIST_LAST((head)).oid,\
(head_new),\
POBJ_LIST_LAST((head_new)).oid,\
0 /* after */, (elm).oid)
#define POBJ_LIST_MOVE_ELEMENT_AFTER(pop,\
head, head_new, listelm, elm, field, field_new)\
pmemobj_list_move((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)),\
(head),\
offsetof(typeof (*(POBJ_LIST_FIRST(head_new)._type)), field_new),\
&POBJ_LIST_FIRST((head_new)),\
(head_new),\
(listelm).oid,\
0 /* after */, (elm).oid)
......@@ -471,9 +471,9 @@ pmemobj_list_move((pop),\
head, head_new, listelm, elm, field, field_new)\
pmemobj_list_move((pop),\
offsetof(typeof (*(POBJ_LIST_FIRST(head)._type)), field),\
&POBJ_LIST_FIRST((head)),\
(head),\
offsetof(typeof (*(POBJ_LIST_FIRST(head_new)._type)), field_new),\
&POBJ_LIST_FIRST((head_new)),\
(head_new),\
(listelm).oid,\
1 /* before */, (elm).oid)
......
......@@ -521,7 +521,6 @@ tx_post_commit(PMEMobjpool *pop, struct lane_tx_layout *layout)
return 0;
}
/*
* tx_abort -- (internal) abort all allocated objects
*/
......
......@@ -39,7 +39,7 @@ export UNITTEST_NUM=0
setup
expect_abnormal_exit\
expect_normal_exit\
./obj_basic_integration$EXESUFFIX $DIR/testfile1 2> /dev/null
rm -rf $DIR/testfile1
......
......@@ -179,15 +179,14 @@ test_tx_api(PMEMobjpool *pop)
TX_MEMCPY(D_RW(root)->node, teststr, TEST_STR, TEST_STR_LEN);
TX_SET(D_RW(root)->node, value, TEST_VALUE);
} TX_FINALLY {
if (vstate)
FREE(vstate);
FREE(vstate);
vstate = NULL;
} TX_END
ASSERTeq(vstate, NULL);
ASSERTeq(D_RW(root)->value, TEST_VALUE);
TX_BEGIN_LOCK(pop, &D_RW(root)->lock) {
TX_BEGIN_LOCK(pop, TX_LOCK_MUTEX, &D_RW(root)->lock) {
ASSERT(!OID_IS_NULL(D_RW(root)->node));
TX_FREE(D_RW(root)->node);
OID_ASSIGN(D_RW(root)->node, OID_NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment