Skip to content

Commit

Permalink
ordering tests for tid_word flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Nov 6, 2024
1 parent 0f1d136 commit 8999ea3
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_lockbit) {
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 8999ea3

Please sign in to comment.