예제 #1
0
TEST_F(ThreeWayMergeTest, SameMetaKeyModifyConflict)
{
	ours.lookup ("user/parento/config/key1").setMeta<std::string> ("testmeta", "ourvalue");
	theirs.lookup ("user/parentt/config/key1").setMeta<std::string> ("testmeta", "theirvalue");

	MergeResult result = merger.mergeKeySet (base, ours, theirs, mergeParent);

	ASSERT_TRUE (result.hasConflicts())<< "No conflict detected although conflicts should exist";
	KeySet conflicts = result.getConflictSet ();
	EXPECT_EQ(1, conflicts.size ());
	testConflictMeta (conflicts.at (0), CONFLICT_META, CONFLICT_META);
	KeySet merged = result.getMergedKeys ();
	EXPECT_EQ(4, merged.size ());
	compareAllExceptKey1 (merged);
}
예제 #2
0
TEST_F(ThreeWayMergeTest, DeleteModifyConflict)
{
	ours.lookup ("user/parento/config/key1", KDB_O_POP);
	theirs.lookup ("user/parentt/config/key1").setString ("modifiedvalue");

	MergeResult result = merger.mergeKeySet (base, ours, theirs, mergeParent);

	EXPECT_TRUE(result.hasConflicts()) << "No conflict detected although conflicts should exist";
	KeySet conflicts = result.getConflictSet ();
	ASSERT_EQ(1, conflicts.size())<< "Wrong number of conflicts";
	testConflictMeta (conflicts.at (0), CONFLICT_DELETE, CONFLICT_MODIFY);
	KeySet merged = result.getMergedKeys ();
	EXPECT_EQ(4, merged.size ());
	compareAllExceptKey1 (merged);
}
예제 #3
0
TEST_F(ThreeWayMergeTest, SameAddedDifferentValueConflict)
{
	ours.append (Key ("user/parento/config/key5", KEY_VALUE, "newvalueours", KEY_END));
	theirs.append (Key ("user/parentt/config/key5", KEY_VALUE, "newvaluetheirs", KEY_END));

	MergeResult result = merger.mergeKeySet (base, ours, theirs, mergeParent);

	ASSERT_TRUE (result.hasConflicts())<< "No conflict detected although conflicts should exist";

	KeySet conflicts = result.getConflictSet ();
	EXPECT_EQ(1, conflicts.size ());
	testConflictMeta (conflicts.at (0), CONFLICT_ADD, CONFLICT_ADD);

	KeySet merged = result.getMergedKeys ();

	EXPECT_EQ(5, merged.size ());

	compareAllKeys (merged);
}