diff --git a/tests/unit-tests/bench.t.cpp b/tests/unit-tests/bench.t.cpp
index 6f7b61c..7e321e3 100644
--- a/tests/unit-tests/bench.t.cpp
+++ b/tests/unit-tests/bench.t.cpp
@@ -130,8 +130,8 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       state.onChallengeResponse(response);
-      BOOST_CHECK(state.status == Status::CHALLENGE);
-      BOOST_CHECK_EQUAL(state.challengeStatus, ChallengePin::NEED_CODE);
+      BOOST_CHECK(state.m_status == Status::CHALLENGE);
+      BOOST_CHECK_EQUAL(state.m_challengeStatus, ChallengePin::NEED_CODE);
       auto paramList = state.selectOrContinueChallenge("pin");
       challengeInterest2 = state.genChallengeInterest(std::move(paramList));
     }
@@ -140,8 +140,8 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       state.onChallengeResponse(response);
-      BOOST_CHECK(state.status == Status::CHALLENGE);
-      BOOST_CHECK_EQUAL(state.challengeStatus, ChallengePin::WRONG_CODE);
+      BOOST_CHECK(state.m_status == Status::CHALLENGE);
+      BOOST_CHECK_EQUAL(state.m_challengeStatus, ChallengePin::WRONG_CODE);
 
       auto paramList = state.selectOrContinueChallenge("pin");
       auto request = ca.getCertificateRequest(*challengeInterest2);
@@ -155,7 +155,7 @@
       count++;
       BOOST_CHECK(security::verifySignature(response, cert));
       state.onChallengeResponse(response);
-      BOOST_CHECK(state.status == Status::SUCCESS);
+      BOOST_CHECK(state.m_status == Status::SUCCESS);
     }
   });
 
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index 3c4dbb4..385f7ef 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -262,7 +262,7 @@
     RequestId requestId;
     std::memcpy(requestId.data(), contentBlock.get(tlv::RequestId).value(), contentBlock.get(tlv::RequestId).value_size());
     auto ca_encryption_key = ca.getCaStorage()->getRequest(requestId).encryptionKey;
-    BOOST_CHECK_EQUAL_COLLECTIONS(state.aesKey.begin(), state.aesKey.end(),
+    BOOST_CHECK_EQUAL_COLLECTIONS(state.m_aesKey.begin(), state.m_aesKey.end(),
                                   ca_encryption_key.begin(), ca_encryption_key.end());
   });
   face.receive(*interest);
@@ -450,8 +450,8 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       state.onChallengeResponse(response);
-      BOOST_CHECK(state.status == Status::CHALLENGE);
-      BOOST_CHECK_EQUAL(state.challengeStatus, ChallengePin::NEED_CODE);
+      BOOST_CHECK(state.m_status == Status::CHALLENGE);
+      BOOST_CHECK_EQUAL(state.m_challengeStatus, ChallengePin::NEED_CODE);
       auto paramList = state.selectOrContinueChallenge("pin");
       challengeInterest2 = state.genChallengeInterest(std::move(paramList));
     }
@@ -460,8 +460,8 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       state.onChallengeResponse(response);
-      BOOST_CHECK(state.status == Status::CHALLENGE);
-      BOOST_CHECK_EQUAL(state.challengeStatus, ChallengePin::WRONG_CODE);
+      BOOST_CHECK(state.m_status == Status::CHALLENGE);
+      BOOST_CHECK_EQUAL(state.m_challengeStatus, ChallengePin::WRONG_CODE);
 
       auto paramList = state.selectOrContinueChallenge("pin");
       auto request = ca.getCertificateRequest(*challengeInterest2);
@@ -473,7 +473,7 @@
       count++;
       BOOST_CHECK(security::verifySignature(response, cert));
       state.onChallengeResponse(response);
-      BOOST_CHECK(state.status == Status::SUCCESS);
+      BOOST_CHECK(state.m_status == Status::SUCCESS);
     }
   });
 
@@ -550,7 +550,7 @@
     RequestId requestId;
     std::memcpy(requestId.data(), contentBlock.get(tlv::RequestId).value(), contentBlock.get(tlv::RequestId).value_size());
     auto ca_encryption_key = ca.getCaStorage()->getRequest(requestId).encryptionKey;
-    BOOST_CHECK_EQUAL_COLLECTIONS(state.aesKey.begin(), state.aesKey.end(),
+    BOOST_CHECK_EQUAL_COLLECTIONS(state.m_aesKey.begin(), state.m_aesKey.end(),
                                   ca_encryption_key.begin(), ca_encryption_key.end());
   });
   face.receive(*interest);
diff --git a/tests/unit-tests/protocol-encoders.t.cpp b/tests/unit-tests/protocol-encoders.t.cpp
index 23ee95a..61128e3 100644
--- a/tests/unit-tests/protocol-encoders.t.cpp
+++ b/tests/unit-tests/protocol-encoders.t.cpp
@@ -158,16 +158,16 @@
   auto contentBlock = challengetlv::encodeDataContent(state, Name("/ndn/ucla/a/b/c"));
 
   requester::Request context(m_keyChain, caCache.getKnownProfiles().front(), RequestType::NEW);
-  context.requestId = id;
-  std::memcpy(context.aesKey.data(), key, sizeof(key));
+  context.m_requestId = id;
+  std::memcpy(context.m_aesKey.data(), key, sizeof(key));
   advanceClocks(time::seconds(10));
   challengetlv::decodeDataContent(contentBlock, context);
 
-  BOOST_CHECK_EQUAL(static_cast<size_t>(context.status), static_cast<size_t>(Status::PENDING));
-  BOOST_CHECK_EQUAL(context.challengeStatus, "test");
-  BOOST_CHECK_EQUAL(context.remainingTries, 3);
-  BOOST_CHECK_EQUAL(context.freshBefore, tp + time::seconds(3600) + time::seconds(10));
-  BOOST_CHECK_EQUAL(context.issuedCertName, "/ndn/ucla/a/b/c");
+  BOOST_CHECK_EQUAL(static_cast<size_t>(context.m_status), static_cast<size_t>(Status::PENDING));
+  BOOST_CHECK_EQUAL(context.m_challengeStatus, "test");
+  BOOST_CHECK_EQUAL(context.m_remainingTries, 3);
+  BOOST_CHECK_EQUAL(context.m_freshBefore, tp + time::seconds(3600) + time::seconds(10));
+  BOOST_CHECK_EQUAL(context.m_issuedCertName, "/ndn/ucla/a/b/c");
 }
 
 BOOST_AUTO_TEST_SUITE_END()
