Skip to content

Commit

Permalink
check tid_word oreder around flag bits
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Nov 8, 2024
1 parent b635e84 commit 1c1d259
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/tid_word/tid_word_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,31 @@ TEST_F(tid_word_test, tid_keeps_ordered) {
}
}

TEST_F(tid_word_test, tid_is_stronger_than_lock) {
tid_word t1{}, t2{};
t1.set_tid(1);
t1.set_lock(true);
t2.set_tid(2);
t2.set_lock(false);
EXPECT_LT(t1, t2);
}

TEST_F(tid_word_test, tid_is_stronger_than_absent) {
tid_word t1{}, t2{};
t1.set_tid(1);
t1.set_absent(true);
t2.set_tid(2);
t2.set_absent(false);
EXPECT_LT(t1, t2);
}

TEST_F(tid_word_test, absent_is_stronger_than_lock) {
tid_word t1{}, t2{};
t1.set_lock(true);
t1.set_absent(false);
t2.set_lock(false);
t2.set_absent(true);
EXPECT_LT(t1, t2);
}

} // namespace shirakami::testing

0 comments on commit 1c1d259

Please sign in to comment.