diff --git a/src/avalanche/test/voterecord_tests.cpp b/src/avalanche/test/voterecord_tests.cpp
--- a/src/avalanche/test/voterecord_tests.cpp
+++ b/src/avalanche/test/voterecord_tests.cpp
@@ -10,25 +10,28 @@
 
 using namespace avalanche;
 
-NodeId nextNodeId(NodeId &nodeid) {
-    nodeid++;
-    if (nodeid >= 8) {
-        nodeid = 0;
+struct VoteRecordFixture : public TestingSetup {
+    NodeId currentNodeId = -1;
+
+    NodeId nextNodeId() {
+        currentNodeId++;
+        if (currentNodeId >= 8) {
+            currentNodeId = 0;
+        }
+        return currentNodeId;
     }
-    return nodeid;
-}
+};
 
-BOOST_FIXTURE_TEST_SUITE(voterecord_tests, TestingSetup)
+BOOST_FIXTURE_TEST_SUITE(voterecord_tests, VoteRecordFixture)
 
 #define REGISTER_VOTE_AND_CHECK(vr, vote, state, finalized, stale, confidence) \
-    vr.registerVote(nextNodeId(nodeid), vote);                                 \
+    vr.registerVote(nextNodeId(), vote);                                       \
     BOOST_CHECK_EQUAL(vr.isAccepted(), state);                                 \
     BOOST_CHECK_EQUAL(vr.hasFinalized(), finalized);                           \
     BOOST_CHECK_EQUAL(vr.isStale(), stale);                                    \
     BOOST_CHECK_EQUAL(vr.getConfidence(), confidence);
 
 BOOST_AUTO_TEST_CASE(vote_record) {
-    NodeId nodeid = -1;
     VoteRecord vraccepted(true);
 
     // Check initial state.
@@ -133,7 +136,6 @@
 }
 
 BOOST_AUTO_TEST_CASE(stale_vote) {
-    NodeId nodeid = -1;
     // Setup a record that is inconclusive so far
     VoteRecord vr(false);
     for (uint32_t i = 0; i < AVALANCHE_VOTE_STALE_THRESHOLD / 8; i++) {
@@ -153,7 +155,6 @@
 }
 
 BOOST_AUTO_TEST_CASE(stale_vote_after_confidence_flip) {
-    NodeId nodeid = -1;
     auto voteCount = 0;
     // Setup a record that is inconclusive so far
     VoteRecord vr(false);
@@ -186,18 +187,17 @@
 
 BOOST_AUTO_TEST_CASE(duplicate_votes) {
     VoteRecord vr(true);
-    NodeId nodeid = -1;
 
     // Register some votes, expecting confidence to increase
     for (auto i = 0; i < 7; i++) {
         BOOST_CHECK_EQUAL(vr.getConfidence(), 0);
-        BOOST_CHECK(!vr.registerVote(nextNodeId(nodeid), 0));
+        BOOST_CHECK(!vr.registerVote(nextNodeId(), 0));
     }
     BOOST_CHECK_EQUAL(vr.getConfidence(), 1);
 
     // Multiple duplicate votes do not advance confidence
     for (auto i = 0; i < 8; i++) {
-        BOOST_CHECK(!vr.registerVote(nodeid, 0));
+        BOOST_CHECK(!vr.registerVote(currentNodeId, 0));
         BOOST_CHECK_EQUAL(vr.getConfidence(), 1);
     }
 
@@ -205,10 +205,10 @@
     // increase when duplicates are not used.
     auto expectedConfidence = 1;
     for (auto i = 0; i < 8; i++) {
-        BOOST_CHECK(!vr.registerVote(nodeid, 0));
+        BOOST_CHECK(!vr.registerVote(currentNodeId, 0));
         BOOST_CHECK_EQUAL(vr.getConfidence(), expectedConfidence);
         for (auto j = i; j < 8; j++) {
-            BOOST_CHECK(!vr.registerVote(nextNodeId(nodeid), 0));
+            BOOST_CHECK(!vr.registerVote(nextNodeId(), 0));
             BOOST_CHECK_EQUAL(vr.getConfidence(), ++expectedConfidence);
         }
     }