Skip to content

Commit 88320e1

Browse files
committed
Fix CodeRabbit review inline comments in raft_group_tests
- TearDown: Add cleanup for raft_group_2.state and raft_group_3.state - AppendEntriesArgsStructure: Replace tautological EXPECT_TRUE(true) with real assertions on term, leader_id, prev_log_index, prev_log_term, leader_commit, and entries.empty()
1 parent aa321c9 commit 88320e1

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/raft_group_tests.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ class RaftGroupTests : public ::testing::Test {
4646
if (rpc_) {
4747
rpc_->stop();
4848
}
49-
// Cleanup state files
49+
// Cleanup state files for all possible group IDs
5050
std::remove("raft_group_1.state");
51+
std::remove("raft_group_2.state");
52+
std::remove("raft_group_3.state");
5153
}
5254

5355
config::Config config_;
@@ -127,8 +129,13 @@ TEST_F(RaftGroupTests, AppendEntriesArgsStructure) {
127129
args.prev_log_term = 1;
128130
args.leader_commit = 3;
129131

130-
// Empty entries vector should be valid
131-
EXPECT_TRUE(true); // Structure is valid
132+
// Verify all fields are set correctly
133+
EXPECT_EQ(args.term, 1);
134+
EXPECT_EQ(args.leader_id, "leader1");
135+
EXPECT_EQ(args.prev_log_index, 5);
136+
EXPECT_EQ(args.prev_log_term, 1);
137+
EXPECT_EQ(args.leader_commit, 3);
138+
EXPECT_TRUE(args.entries.empty());
132139
}
133140

134141
// ============= Log Entry Tests =============

0 commit comments

Comments
 (0)