if (config.parentItem &&
config.childItem) {
ADD_TEST(LocalTests, testLinkedItemsParent);
- ADD_TEST(LocalTests, testLinkedItemsChild);
+ if (config.linkedItemsRelaxedSemantic) {
+ ADD_TEST(LocalTests, testLinkedItemsChild);
+ }
ADD_TEST(LocalTests, testLinkedItemsParentChild);
- ADD_TEST(LocalTests, testLinkedItemsChildParent);
- ADD_TEST(LocalTests, testLinkedItemsChildChangesParent);
- ADD_TEST(LocalTests, testLinkedItemsRemoveParentFirst);
+ if (config.linkedItemsRelaxedSemantic) {
+ ADD_TEST(LocalTests, testLinkedItemsChildParent);
+ }
+ if (config.linkedItemsRelaxedSemantic) {
+ ADD_TEST(LocalTests, testLinkedItemsChildChangesParent);
+ }
+ if (config.linkedItemsRelaxedSemantic) {
+ ADD_TEST(LocalTests, testLinkedItemsRemoveParentFirst);
+ }
ADD_TEST(LocalTests, testLinkedItemsRemoveNormal);
if (config.sourceKnowsItemSemantic) {
ADD_TEST(LocalTests, testLinkedItemsInsertParentTwice);
- ADD_TEST(LocalTests, testLinkedItemsInsertChildTwice);
+ if (config.linkedItemsRelaxedSemantic) {
+ ADD_TEST(LocalTests, testLinkedItemsInsertChildTwice);
+ }
}
ADD_TEST(LocalTests, testLinkedItemsParentUpdate);
- ADD_TEST(LocalTests, testLinkedItemsUpdateChild);
+ if (config.linkedItemsRelaxedSemantic) {
+ ADD_TEST(LocalTests, testLinkedItemsUpdateChild);
+ }
ADD_TEST(LocalTests, testLinkedItemsInsertBothUpdateChild);
ADD_TEST(LocalTests, testLinkedItemsInsertBothUpdateParent);
}
// test inserting, removing and updating of parent + child item in
// various order plus change tracking
void LocalTests::testLinkedItemsChild() {
-#if LINKED_ITEMS_RELAXED_SEMANTIC
// check additional requirements
CPPUNIT_ASSERT(config.parentItem);
CPPUNIT_ASSERT(config.childItem);
SOURCE_ASSERT_EQUAL(copy.get(), 0, countUpdatedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countDeletedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countEqual(listDeletedItems(copy.get()), child));
-#endif
}
// test inserting, removing and updating of parent + child item in
// test inserting, removing and updating of parent + child item in
// various order plus change tracking
void LocalTests::testLinkedItemsChildParent() {
-#if LINKED_ITEMS_RELAXED_SEMANTIC
// check additional requirements
CPPUNIT_ASSERT(config.parentItem);
CPPUNIT_ASSERT(config.childItem);
SOURCE_ASSERT_EQUAL(copy.get(), 2, countDeletedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countEqual(listDeletedItems(copy.get()), child));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countEqual(listDeletedItems(copy.get()), parent));
-#endif
}
// test inserting, removing and updating of parent + child item in
// various order plus change tracking
void LocalTests::testLinkedItemsChildChangesParent() {
-#if LINKED_ITEMS_RELAXED_SEMANTIC
// check additional requirements
CPPUNIT_ASSERT(config.parentItem);
CPPUNIT_ASSERT(config.childItem);
SOURCE_ASSERT_EQUAL(copy.get(), 2, countDeletedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countEqual(listDeletedItems(copy.get()), child));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countEqual(listDeletedItems(copy.get()), parent));
-#endif
}
// test inserting, removing and updating of parent + child item in
// various order plus change tracking
void LocalTests::testLinkedItemsRemoveParentFirst() {
-#if LINKED_ITEMS_RELAXED_SEMANTIC
// check additional requirements
CPPUNIT_ASSERT(config.parentItem);
CPPUNIT_ASSERT(config.childItem);
SOURCE_ASSERT_EQUAL(copy.get(), 1, countDeletedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countEqual(listDeletedItems(copy.get()), child));
CPPUNIT_ASSERT_NO_THROW(copy.reset());
-#endif
}
// test inserting, removing and updating of parent + child item in
SOURCE_ASSERT_EQUAL(copy.get(), 0, countItems(copy.get()));
CPPUNIT_ASSERT_NO_THROW(copy.reset());
-#if LINKED_ITEMS_RELAXED_SEMANTIC
// add child twice (should be turned into update)
child = insert(createSourceA, config.childItem);
SOURCE_ASSERT_EQUAL(copy.get(), 0, countUpdatedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countDeletedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countEqual(listDeletedItems(copy.get()), child));
-#endif
}
// test inserting, removing and updating of parent + child item in
// test inserting, removing and updating of parent + child item in
// various order plus change tracking
void LocalTests::testLinkedItemsUpdateChild() {
-#if LINKED_ITEMS_RELAXED_SEMANTIC
// check additional requirements
CPPUNIT_ASSERT(config.parentItem);
CPPUNIT_ASSERT(config.childItem);
SOURCE_ASSERT_EQUAL(copy.get(), 0, countUpdatedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countDeletedItems(copy.get()));
SOURCE_ASSERT_EQUAL(copy.get(), 1, countEqual(listDeletedItems(copy.get()), child));
- CPPUNIT_ASSERT_NO_THROW(copy.reset());
-#endif
}
// test inserting, removing and updating of parent + child item in
env = getenv("CLIENT_TEST_SUSPEND");
config.suspendSync = (env && !strcmp (env, "t")) ?true :false;
config.sourceKnowsItemSemantic = true;
+ config.linkedItemsRelaxedSemantic = true;
config.itemType = "";
config.import = import;
config.dump = dump;