Skip to content

Commit

Permalink
core: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Jul 19, 2023
1 parent 1541167 commit 091cd1f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/unit-tests/core.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,18 @@ struct TestCoreFixture
Name m_syncPrefix;
SVSyncCore m_core;

std::vector<MissingDataInfo> missingData;

void
update(const std::vector<MissingDataInfo>& v)
{
for (auto m : v)
missingData.push_back(m);
}
};

BOOST_FIXTURE_TEST_SUITE(TestCore, TestCoreFixture)

BOOST_AUTO_TEST_CASE(mergeStateVector)
{
std::vector<MissingDataInfo> missingData;

VersionVector v = m_core.getState();
BOOST_CHECK_EQUAL(v.get("one"), 0);
BOOST_CHECK_EQUAL(v.get("two"), 0);
Expand All @@ -57,7 +55,7 @@ BOOST_AUTO_TEST_CASE(mergeStateVector)
VersionVector v1;
v1.set("one", 1);
v1.set("two", 2);
m_core.mergeStateVector(v1);
missingData = std::get<2>(m_core.mergeStateVector(v1));

v = m_core.getState();
BOOST_CHECK_EQUAL(v.get("one"), 1);
Expand All @@ -69,8 +67,7 @@ BOOST_AUTO_TEST_CASE(mergeStateVector)
v2.set("one", 1);
v2.set("two", 1);
v2.set("three", 3);
missingData.clear();
m_core.mergeStateVector(v2);
missingData = std::get<2>(m_core.mergeStateVector(v2));

v = m_core.getState();
BOOST_CHECK_EQUAL(v.get("one"), 1);
Expand Down

0 comments on commit 091cd1f

Please sign in to comment.