fix cr
Change-Id: I683943c014a8615711bd8a7b570acfe8d3b51a3e
diff --git a/tests/unit-tests/bench.t.cpp b/tests/unit-tests/bench.t.cpp
index 9403c39..1fffef1 100644
--- a/tests/unit-tests/bench.t.cpp
+++ b/tests/unit-tests/bench.t.cpp
@@ -143,7 +143,7 @@
auto paramList = requester::Requester::selectOrContinueChallenge(state, "pin");
auto request = ca.getCertificateRequest(*challengeInterest2);
- auto secret = request->m_challengeState->m_secrets.get(ChallengePin::PARAMETER_KEY_CODE, "");
+ auto secret = request->challengeState->secrets.get(ChallengePin::PARAMETER_KEY_CODE, "");
paramList.begin()->second = secret;
challengeInterest3 = requester::Requester::genChallengeInterest(state, std::move(paramList));
// std::cout << "CHALLENGE Interest Size: " << challengeInterest3->wireEncode().size() << std::endl;
diff --git a/tests/unit-tests/ca-memory.t.cpp b/tests/unit-tests/ca-memory.t.cpp
index c9d9f74..3a69e0b 100644
--- a/tests/unit-tests/ca-memory.t.cpp
+++ b/tests/unit-tests/ca-memory.t.cpp
@@ -47,11 +47,11 @@
// get operation
auto result = storage.getRequest(requestId);
- BOOST_CHECK_EQUAL(request1.m_cert, result.m_cert);
- BOOST_CHECK(request1.m_status == result.m_status);
- BOOST_CHECK_EQUAL(request1.m_caPrefix, result.m_caPrefix);
- BOOST_CHECK_EQUAL_COLLECTIONS(request1.m_encryptionKey.begin(), request1.m_encryptionKey.end(),
- result.m_encryptionKey.begin(), result.m_encryptionKey.end());
+ BOOST_CHECK_EQUAL(request1.cert, result.cert);
+ BOOST_CHECK(request1.status == result.status);
+ BOOST_CHECK_EQUAL(request1.caPrefix, result.caPrefix);
+ BOOST_CHECK_EQUAL_COLLECTIONS(request1.encryptionKey.begin(), request1.encryptionKey.end(),
+ result.encryptionKey.begin(), result.encryptionKey.end());
JsonSection json;
json.put("code", "1234");
@@ -63,9 +63,9 @@
std::move(json), std::move(aesKey2), 0);
storage.updateRequest(request2);
result = storage.getRequest(requestId);
- BOOST_CHECK_EQUAL(request2.m_cert, result.m_cert);
- BOOST_CHECK(request2.m_status == result.m_status);
- BOOST_CHECK_EQUAL(request2.m_caPrefix, result.m_caPrefix);
+ BOOST_CHECK_EQUAL(request2.cert, result.cert);
+ BOOST_CHECK(request2.status == result.status);
+ BOOST_CHECK_EQUAL(request2.caPrefix, result.caPrefix);
auto identity2 = addIdentity(Name("/ndn/site2"));
auto key2 = identity2.getDefaultKey();
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index da8284c..b2d3300 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -259,7 +259,7 @@
auto challengeList = requester::Requester::onNewRenewRevokeResponse(state, response);
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).m_encryptionKey;
+ auto ca_encryption_key = ca.getCaStorage()->getRequest(requestId).encryptionKey;
BOOST_CHECK_EQUAL_COLLECTIONS(state.m_aesKey.begin(), state.m_aesKey.end(),
ca_encryption_key.begin(), ca_encryption_key.end());
});
@@ -422,7 +422,7 @@
auto paramList = requester::Requester::selectOrContinueChallenge(state, "pin");
auto request = ca.getCertificateRequest(*challengeInterest2);
- auto secret = request->m_challengeState->m_secrets.get(ChallengePin::PARAMETER_KEY_CODE, "");
+ auto secret = request->challengeState->secrets.get(ChallengePin::PARAMETER_KEY_CODE, "");
paramList.begin()->second = secret;
challengeInterest3 = requester::Requester::genChallengeInterest(state, std::move(paramList));
}
@@ -502,7 +502,7 @@
auto challengeList = requester::Requester::onNewRenewRevokeResponse(state, response);
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).m_encryptionKey;
+ auto ca_encryption_key = ca.getCaStorage()->getRequest(requestId).encryptionKey;
BOOST_CHECK_EQUAL_COLLECTIONS(state.m_aesKey.begin(), state.m_aesKey.end(),
ca_encryption_key.begin(), ca_encryption_key.end());
});
diff --git a/tests/unit-tests/ca-sqlite.t.cpp b/tests/unit-tests/ca-sqlite.t.cpp
index f609d4f..f0383ff 100644
--- a/tests/unit-tests/ca-sqlite.t.cpp
+++ b/tests/unit-tests/ca-sqlite.t.cpp
@@ -45,11 +45,11 @@
// get operation
auto result = storage.getRequest(requestId);
- BOOST_CHECK_EQUAL(request1.m_cert, result.m_cert);
- BOOST_CHECK(request1.m_status == result.m_status);
- BOOST_CHECK_EQUAL(request1.m_caPrefix, result.m_caPrefix);
- BOOST_CHECK_EQUAL_COLLECTIONS(request1.m_encryptionKey.begin(), request1.m_encryptionKey.end(),
- result.m_encryptionKey.begin(), result.m_encryptionKey.end());
+ BOOST_CHECK_EQUAL(request1.cert, result.cert);
+ BOOST_CHECK(request1.status == result.status);
+ BOOST_CHECK_EQUAL(request1.caPrefix, result.caPrefix);
+ BOOST_CHECK_EQUAL_COLLECTIONS(request1.encryptionKey.begin(), request1.encryptionKey.end(),
+ result.encryptionKey.begin(), result.encryptionKey.end());
// update operation
JsonSection json;
@@ -60,9 +60,9 @@
std::move(json), std::move(aesKey2), 0);
storage.updateRequest(request2);
result = storage.getRequest(requestId);
- BOOST_CHECK_EQUAL(request2.m_cert, result.m_cert);
- BOOST_CHECK(request2.m_status == result.m_status);
- BOOST_CHECK_EQUAL(request2.m_caPrefix, result.m_caPrefix);
+ BOOST_CHECK_EQUAL(request2.cert, result.cert);
+ BOOST_CHECK(request2.status == result.status);
+ BOOST_CHECK_EQUAL(request2.caPrefix, result.caPrefix);
auto identity2 = addIdentity(Name("/ndn/site2"));
auto key2 = identity2.getDefaultKey();
diff --git a/tests/unit-tests/challenge-credential.t.cpp b/tests/unit-tests/challenge-credential.t.cpp
index 4b91aa2..03cf023 100644
--- a/tests/unit-tests/challenge-credential.t.cpp
+++ b/tests/unit-tests/challenge-credential.t.cpp
@@ -72,11 +72,11 @@
m_keyChain.addCertificate(keyB, credential);
// using private key to sign cert request
- auto params = challenge.getRequestedParameterList(state.m_status, "");
+ auto params = challenge.getRequestedParameterList(state.status, "");
ChallengeCredential::fulfillParameters(params, m_keyChain, credential.getName(), requestId);
- Block paramsTlv = challenge.genChallengeRequestTLV(state.m_status, "", std::move(params));
+ Block paramsTlv = challenge.genChallengeRequestTLV(state.status, "", std::move(params));
challenge.handleChallengeRequest(paramsTlv, state);
- BOOST_CHECK_EQUAL(statusToString(state.m_status), statusToString(Status::PENDING));
+ BOOST_CHECK_EQUAL(statusToString(state.status), statusToString(Status::PENDING));
}
BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/unit-tests/challenge-email.t.cpp b/tests/unit-tests/challenge-email.t.cpp
index 34f2089..429e532 100644
--- a/tests/unit-tests/challenge-email.t.cpp
+++ b/tests/unit-tests/challenge-email.t.cpp
@@ -56,12 +56,12 @@
ChallengeEmail challenge("./tests/unit-tests/test-send-email.sh");
challenge.handleChallengeRequest(paramTLV, request);
- BOOST_CHECK(request.m_status == Status::CHALLENGE);
- BOOST_CHECK_EQUAL(request.m_challengeState->m_challengeStatus, ChallengeEmail::NEED_CODE);
- BOOST_CHECK(request.m_challengeState->m_secrets.get<std::string>(ChallengeEmail::PARAMETER_KEY_CODE) != "");
- BOOST_CHECK(request.m_challengeState->m_remainingTime.count() != 0);
- BOOST_CHECK(request.m_challengeState->m_remainingTries != 0);
- BOOST_CHECK_EQUAL(request.m_challengeType, "email");
+ BOOST_CHECK(request.status == Status::CHALLENGE);
+ BOOST_CHECK_EQUAL(request.challengeState->challengeStatus, ChallengeEmail::NEED_CODE);
+ BOOST_CHECK(request.challengeState->secrets.get<std::string>(ChallengeEmail::PARAMETER_KEY_CODE) != "");
+ BOOST_CHECK(request.challengeState->remainingTime.count() != 0);
+ BOOST_CHECK(request.challengeState->remainingTries != 0);
+ BOOST_CHECK_EQUAL(request.challengeType, "email");
std::string line = "";
std::string delimiter = " ";
@@ -77,7 +77,7 @@
end = line.find(delimiter);
std::string secret = line.substr(0, end);
- auto stored_secret = request.m_challengeState->m_secrets.get<std::string>(ChallengeEmail::PARAMETER_KEY_CODE);
+ auto stored_secret = request.challengeState->secrets.get<std::string>(ChallengeEmail::PARAMETER_KEY_CODE);
BOOST_CHECK_EQUAL(secret, stored_secret);
line = line.substr(end + 1);
@@ -107,9 +107,9 @@
ChallengeEmail challenge;
challenge.handleChallengeRequest(paramTLV, request);
- BOOST_CHECK_EQUAL(request.m_challengeType, "email");
- BOOST_CHECK_EQUAL(request.m_challengeState->m_challengeStatus, ChallengeEmail::INVALID_EMAIL);
- BOOST_CHECK_EQUAL(request.m_challengeState->m_remainingTries, 2);
+ BOOST_CHECK_EQUAL(request.challengeType, "email");
+ BOOST_CHECK_EQUAL(request.challengeState->challengeStatus, ChallengeEmail::INVALID_EMAIL);
+ BOOST_CHECK_EQUAL(request.challengeState->remainingTries, 2);
}
BOOST_AUTO_TEST_CASE(OnChallengeRequestWithCode)
@@ -132,8 +132,8 @@
ChallengeEmail challenge;
challenge.handleChallengeRequest(paramTLV, request);
- BOOST_CHECK(request.m_status == Status::PENDING);
- BOOST_CHECK(!request.m_challengeState);
+ BOOST_CHECK(request.status == Status::PENDING);
+ BOOST_CHECK(!request.challengeState);
}
BOOST_AUTO_TEST_CASE(OnValidateInterestComingWithWrongCode)
@@ -156,9 +156,9 @@
ChallengeEmail challenge;
challenge.handleChallengeRequest(paramTLV, request);
- BOOST_CHECK_EQUAL(request.m_challengeState->m_challengeStatus, ChallengeEmail::WRONG_CODE);
- BOOST_CHECK(request.m_status == Status::CHALLENGE);
- BOOST_CHECK_EQUAL(request.m_challengeState->m_secrets.empty(), false);
+ BOOST_CHECK_EQUAL(request.challengeState->challengeStatus, ChallengeEmail::WRONG_CODE);
+ BOOST_CHECK(request.status == Status::CHALLENGE);
+ BOOST_CHECK_EQUAL(request.challengeState->secrets.empty(), false);
}
BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/unit-tests/challenge-pin.t.cpp b/tests/unit-tests/challenge-pin.t.cpp
index 8366a89..f3b10d8 100644
--- a/tests/unit-tests/challenge-pin.t.cpp
+++ b/tests/unit-tests/challenge-pin.t.cpp
@@ -45,9 +45,9 @@
ChallengePin challenge;
challenge.handleChallengeRequest(makeEmptyBlock(tlv::EncryptedPayload), request);
- BOOST_CHECK(request.m_status == Status::CHALLENGE);
- BOOST_CHECK_EQUAL(request.m_challengeState->m_challengeStatus, ChallengePin::NEED_CODE);
- BOOST_CHECK_EQUAL(request.m_challengeType, "pin");
+ BOOST_CHECK(request.status == Status::CHALLENGE);
+ BOOST_CHECK_EQUAL(request.challengeState->challengeStatus, ChallengePin::NEED_CODE);
+ BOOST_CHECK_EQUAL(request.challengeType, "pin");
}
BOOST_AUTO_TEST_CASE(OnChallengeRequestWithCode)
@@ -70,8 +70,8 @@
ChallengePin challenge;
challenge.handleChallengeRequest(paramTLV, request);
- BOOST_CHECK(request.m_status == Status::PENDING);
- BOOST_CHECK(!request.m_challengeState);
+ BOOST_CHECK(request.status == Status::PENDING);
+ BOOST_CHECK(!request.challengeState);
}
BOOST_AUTO_TEST_CASE(OnChallengeRequestWithWrongCode)
@@ -94,9 +94,9 @@
ChallengePin challenge;
challenge.handleChallengeRequest(paramTLV, request);
- BOOST_CHECK(request.m_status == Status::CHALLENGE);
- BOOST_CHECK_EQUAL(request.m_challengeState->m_challengeStatus, ChallengePin::WRONG_CODE);
- BOOST_CHECK_EQUAL(request.m_challengeState->m_secrets.empty(), false);
+ BOOST_CHECK(request.status == Status::CHALLENGE);
+ BOOST_CHECK_EQUAL(request.challengeState->challengeStatus, ChallengePin::WRONG_CODE);
+ BOOST_CHECK_EQUAL(request.challengeState->secrets.empty(), false);
}
BOOST_AUTO_TEST_SUITE_END()