Added stringappend_test back into the unit tests.

Summary:
With the Makefile now updated to correctly update all .o files, this
should fix the issues recompiling stringappend_test. This should also fix the
"segmentation-fault" that we were getting earlier. Now, stringappend_test should
be clean, and I have added it back to the unit-tests. Also made some minor updates
to the tests themselves.

Test Plan:
1. make clean; make stringappend_test -j 32	(will test it by itself)
2. make clean; make all check -j 32		(to run all unit tests)
3. make clean; make release			(test in release mode)
4. valgrind ./stringappend_test 		(valgrind tests)

Reviewers: haobo, jpaton, dhruba

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D11505
main
Deon Nicholas 12 years ago
parent 6894a50aa7
commit 34ef873290
  1. 3
      Makefile
  2. 20
      utilities/merge_operators/string_append/stringappend_test.cc

@ -63,7 +63,8 @@ TESTS = \
filelock_test \
merge_test \
redis_test \
manual_compaction_test
manual_compaction_test \
stringappend_test
TOOLS = \
sst_dump \

@ -329,6 +329,26 @@ TEST(StringAppendOperatorTest,PersistentVariousKeys) {
slists.Append("b","l;");
slists.Append("c","rogosh");
// The previous changes should be on disk (L0)
// The most recent changes should be in memory (MemTable)
// Hence, this will test both Get() paths.
std::string a,b,c;
slists.Get("a",&a);
slists.Get("b",&b);
slists.Get("c",&c);
ASSERT_EQ(a,"x\nt\nr\nsa\ngh\njk");
ASSERT_EQ(b,"y\n2\ndf\nl;");
ASSERT_EQ(c,"asdasd\nasdasd\nbbnagnagsx\nrogosh");
}
// Reopen the database (the previous changes should persist / be remembered)
{
StringAppendOperator append_op('\n');
auto db = OpenDb(&append_op);
StringLists slists(db);
// All changes should be on disk. This will test VersionSet Get()
std::string a,b,c;
slists.Get("a",&a);
slists.Get("b",&b);

Loading…
Cancel
Save