Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 25, 2021. It is now read-only.

Commit cba89cb

Browse files
committed
added database test for commit
1 parent 9cf3b87 commit cba89cb

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

test/git/db/lib_odb_test.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ BOOST_AUTO_TEST_CASE(lib_actor)
5858
s << d1;
5959
s >> d3;
6060
BOOST_REQUIRE(d3 == d1);
61+
62+
// empty names are not allowed
63+
ActorDate d4;
64+
BOOST_REQUIRE_THROW(s << d4, DeserializationError);
6165
}
6266

6367
BOOST_AUTO_TEST_CASE(lib_commit)
@@ -321,13 +325,25 @@ BOOST_AUTO_TEST_CASE(mem_db_test)
321325
mobj.~MultiObject();
322326
(*it).deserialize(mobj);
323327

324-
BOOST_CHECK(mobj.type == Object::Type::Tree);
325328
BOOST_REQUIRE(mobj.tree == tree);
326329
}
327330

328331
// COMMIT SERIALIZATION AND DESERIALIZATION
329332
///////////////////////////////////////////
330-
333+
{
334+
Commit commit;
335+
commit.author().name = "this";
336+
commit.committer().name = "that";
337+
commit.message() = "hi";
338+
339+
it = modb.insert_object(commit);
340+
BOOST_REQUIRE(modb.count() == 4);
341+
342+
mobj.~MultiObject();
343+
(*it).deserialize(mobj);
344+
345+
BOOST_REQUIRE(mobj.commit == commit);
346+
}
331347

332348
// TODO: test object copy from one database to anotherone
333349

0 commit comments

Comments
 (0)