diff --git a/tests/nexus/test_1_1_9_2_10.cpp b/tests/nexus/test_1_1_9_2_10.cpp index 5342e1ee2..ae9341ef5 100644 --- a/tests/nexus/test_1_1_9_2_10.cpp +++ b/tests/nexus/test_1_1_9_2_10.cpp @@ -200,8 +200,8 @@ void Test9_2_10(void) datasetInfo.Set(kPrimaryPanId); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kLeaderActiveTimestamp); - timestamp.SetTicks(0); datasetInfo.Set(timestamp); } leader.Get().SaveLocal(datasetInfo); @@ -262,14 +262,14 @@ void Test9_2_10(void) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep2); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kPendingTimestampStep2); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::Append(*message, kDelayTimerStep2)); diff --git a/tests/nexus/test_1_1_9_2_15.cpp b/tests/nexus/test_1_1_9_2_15.cpp index 747fc5ae8..0f8bde26f 100644 --- a/tests/nexus/test_1_1_9_2_15.cpp +++ b/tests/nexus/test_1_1_9_2_15.cpp @@ -144,14 +144,14 @@ void SendPendingSet(Node &aCommissioner, SuccessOrQuit(Tlv::Append(*message, aSessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(aActiveTimestamp); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(aPendingTimestamp); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { diff --git a/tests/nexus/test_1_1_9_2_16.cpp b/tests/nexus/test_1_1_9_2_16.cpp index f95388a11..d556bd1f0 100644 --- a/tests/nexus/test_1_1_9_2_16.cpp +++ b/tests/nexus/test_1_1_9_2_16.cpp @@ -262,14 +262,14 @@ void Test9_2_16(void) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep3); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kPendingTimestampStep3); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { @@ -415,14 +415,14 @@ void Test9_2_16(void) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep11); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kPendingTimestampStep11); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { @@ -478,8 +478,8 @@ void Test9_2_16(void) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep13); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::Append(*message, kNetworkNameStep13)); diff --git a/tests/nexus/test_1_1_9_2_17.cpp b/tests/nexus/test_1_1_9_2_17.cpp index 21d86fa5b..a4522cbae 100644 --- a/tests/nexus/test_1_1_9_2_17.cpp +++ b/tests/nexus/test_1_1_9_2_17.cpp @@ -180,8 +180,8 @@ void Test9_2_17(void) } { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kLeader1Timestamp); - timestamp.SetTicks(0); datasetInfo.Set(timestamp); } datasetInfo.Set((1 << kPrimaryChannel) | (1 << kSecondaryChannel)); @@ -204,8 +204,8 @@ void Test9_2_17(void) } { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kLeader2Timestamp); - timestamp.SetTicks(0); datasetInfo.Set(timestamp); } diff --git a/tests/nexus/test_1_1_9_2_18.cpp b/tests/nexus/test_1_1_9_2_18.cpp index 4606035f6..53469f825 100644 --- a/tests/nexus/test_1_1_9_2_18.cpp +++ b/tests/nexus/test_1_1_9_2_18.cpp @@ -170,6 +170,7 @@ void Test9_2_18(void) SuccessOrQuit(datasetInfo.GenerateRandom(leader.GetInstance())); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(1); datasetInfo.Set(timestamp); } @@ -238,6 +239,7 @@ void Test9_2_18(void) activeDatasetInfo.Clear(); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestamp20000); activeDatasetInfo.Set(timestamp); } @@ -291,6 +293,7 @@ void Test9_2_18(void) pendingDatasetInfo1.Clear(); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kPendingTimestamp20); pendingDatasetInfo1.Set(timestamp); timestamp.SetSeconds(kActiveTimestamp20); @@ -349,6 +352,7 @@ void Test9_2_18(void) pendingDatasetInfo2.Clear(); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kPendingTimestamp20); pendingDatasetInfo2.Set(timestamp); timestamp.SetSeconds(kActiveTimestamp20); diff --git a/tests/nexus/test_1_1_9_2_4.cpp b/tests/nexus/test_1_1_9_2_4.cpp index 87827de71..5d7ec0370 100644 --- a/tests/nexus/test_1_1_9_2_4.cpp +++ b/tests/nexus/test_1_1_9_2_4.cpp @@ -344,8 +344,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep2); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::AppendTlv(*message, MeshCoP::Tlv::kChannelMask, kChannelMask, sizeof(kChannelMask))); @@ -446,8 +446,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep6); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::Append(*message, MeshCoP::ChannelTlvValue(0, kSecondaryChannel))); @@ -510,8 +510,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep8); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit( @@ -579,8 +579,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep10); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::AppendTlv(*message, MeshCoP::Tlv::kChannelMask, kChannelMask, sizeof(kChannelMask))); @@ -645,8 +645,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep12); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::AppendTlv(*message, MeshCoP::Tlv::kChannelMask, kChannelMask, sizeof(kChannelMask))); @@ -707,8 +707,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, kInvalidSessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep14); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::AppendTlv(*message, MeshCoP::Tlv::kChannelMask, kChannelMask, sizeof(kChannelMask))); @@ -768,8 +768,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep2); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::AppendTlv(*message, MeshCoP::Tlv::kChannelMask, kChannelMask, sizeof(kChannelMask))); @@ -830,8 +830,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep18); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::AppendTlv(*message, MeshCoP::Tlv::kChannelMask, kChannelMask, sizeof(kChannelMask))); @@ -894,8 +894,8 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep20); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::AppendTlv(*message, MeshCoP::Tlv::kChannelMask, kChannelMask, sizeof(kChannelMask))); diff --git a/tests/nexus/test_1_1_9_2_5.cpp b/tests/nexus/test_1_1_9_2_5.cpp index 2fe73b273..5c27cc0e5 100644 --- a/tests/nexus/test_1_1_9_2_5.cpp +++ b/tests/nexus/test_1_1_9_2_5.cpp @@ -165,8 +165,8 @@ void Test9_2_5(void) SuccessOrQuit(router1.Get().Read(datasetInfo)); + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampStep2); - timestamp.SetTicks(0); datasetInfo.Set(timestamp); datasetInfo.Set(kChannelMaskStep2); datasetInfo.Set( diff --git a/tests/nexus/test_1_1_9_2_6.cpp b/tests/nexus/test_1_1_9_2_6.cpp index 495e438ec..9fc7ef03b 100644 --- a/tests/nexus/test_1_1_9_2_6.cpp +++ b/tests/nexus/test_1_1_9_2_6.cpp @@ -300,6 +300,7 @@ void Test9_2_6(void) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampNew); SuccessOrQuit(Tlv::Append(*message, timestamp)); } @@ -501,11 +502,13 @@ void Test9_2_6(void) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampFinal); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kPendingTimestamp); SuccessOrQuit(Tlv::Append(*message, timestamp)); } diff --git a/tests/nexus/test_1_1_9_2_7.cpp b/tests/nexus/test_1_1_9_2_7.cpp index 48de20698..ec0194ca4 100644 --- a/tests/nexus/test_1_1_9_2_7.cpp +++ b/tests/nexus/test_1_1_9_2_7.cpp @@ -280,9 +280,9 @@ void Test9_2_7(void) { MeshCoP::Timestamp timestamp; + timestamp.Clear(); // Deviation from spec: Step 5 uses 15 instead of 20 to ensure it is older than the timestamp in Step 11. timestamp.SetSeconds(kActiveTimestampStep5); - timestamp.SetTicks(0); datasetInfo.Set(timestamp); } @@ -397,6 +397,7 @@ void Test9_2_7(void) Coap::Message *message; MeshCoP::Dataset dataset; MeshCoP::Timestamp timestamp; + timestamp.Clear(); message = agent.NewPriorityConfirmablePostMessage(ot::kUriPendingSet); VerifyOrQuit(message != nullptr); @@ -404,11 +405,9 @@ void Test9_2_7(void) SuccessOrQuit(router.Get().Read(dataset)); timestamp.SetSeconds(kActiveTimestampRouter); - timestamp.SetTicks(0); SuccessOrQuit(dataset.Write(timestamp)); timestamp.SetSeconds(kPendingTimestampRouter); - timestamp.SetTicks(0); SuccessOrQuit(dataset.Write(timestamp)); SuccessOrQuit(dataset.Write(kDelayTimerStep11 * 1000)); @@ -532,14 +531,14 @@ void Test9_2_7(void) SuccessOrQuit(Tlv::Append(*message, sessionId)); { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kPendingTimestampCommissioner); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } { MeshCoP::Timestamp timestamp; + timestamp.Clear(); timestamp.SetSeconds(kActiveTimestampCommissioner); - timestamp.SetTicks(0); SuccessOrQuit(Tlv::Append(*message, timestamp)); } SuccessOrQuit(Tlv::Append(*message, kDelayTimerStep17 * 1000));