461ea65ad4
Summary: Add tests. Merge branch 'dev' into remove_locks Everything works. Refactor complete. Documentation: https://phabricator.memgraph.io/w/memgraph_implementation/indexing/ Reviewers: buda, mislav.bradac, florijan Reviewed By: florijan Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D258
31 lines
630 B
C++
31 lines
630 B
C++
#include "gtest/gtest.h"
|
|
|
|
#include "mvcc/id.hpp"
|
|
|
|
TEST(IdTest, BasicUsageAndTotalOrdering) {
|
|
Id id0(0);
|
|
Id id1(1);
|
|
Id id2(1);
|
|
Id id3(id2);
|
|
Id id4 = id3;
|
|
Id id5(5);
|
|
|
|
ASSERT_EQ(id0 < id5, true);
|
|
ASSERT_EQ(id1 == id2, true);
|
|
ASSERT_EQ(id3 == id4, true);
|
|
ASSERT_EQ(id5 > id0, true);
|
|
ASSERT_EQ(id5 > id0, true);
|
|
ASSERT_EQ(id5 != id3, true);
|
|
ASSERT_EQ(id1 >= id2, true);
|
|
ASSERT_EQ(id3 <= id4, true);
|
|
}
|
|
|
|
TEST(IdTest, MaxId) {
|
|
EXPECT_TRUE(Id(std::numeric_limits<uint64_t>::max()) == Id::MaximalId());
|
|
}
|
|
|
|
int main(int argc, char **argv) {
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
return RUN_ALL_TESTS();
|
|
}
|