Searched refs:testCase (Results 1 – 6 of 6) sorted by relevance
/openthread-3.5.0/tests/unit/ |
D | test_hmac_sha256.cpp | 99 for (const TestCase &testCase : kTestCases) in TestSha256() local 105 sha256.Update(testCase.mData, static_cast<uint16_t>(strlen(testCase.mData))); in TestSha256() 108 VerifyOrQuit(hash == static_cast<const Crypto::HmacSha256::Hash &>(testCase.mHash)); in TestSha256() 115 for (const TestCase &testCase : kTestCases) in TestSha256() local 119 …SuccessOrQuit(message->AppendBytes(testCase.mData, static_cast<uint16_t>(strlen(testCase.mData)))); in TestSha256() 125 for (const TestCase &testCase : kTestCases) in TestSha256() local 131 sha256.Update(*message, offsets[index++], static_cast<uint16_t>(strlen(testCase.mData))); in TestSha256() 134 VerifyOrQuit(hash == static_cast<const Crypto::HmacSha256::Hash &>(testCase.mHash)); in TestSha256() 242 for (const TestCase &testCase : kTestCases) in TestHmacSha256() local 247 hmac.Start(static_cast<const Crypto::Key &>(testCase.mKey)); in TestHmacSha256() [all …]
|
D | test_ip_address.cpp | 551 for (const TestCase &testCase : kTestCases) in TestIp6Prefix() local 553 printf(" %26s < %s\n", testCase.mPrefixA.ToString().AsCString(), in TestIp6Prefix() 554 testCase.mPrefixB.ToString().AsCString()); in TestIp6Prefix() 555 VerifyOrQuit(testCase.mPrefixA < testCase.mPrefixB); in TestIp6Prefix() 556 VerifyOrQuit(!(testCase.mPrefixB < testCase.mPrefixA)); in TestIp6Prefix() 790 for (const TestCase &testCase : kTestCases) in TestIp4Ip6Translation() local 796 SuccessOrQuit(address.FromString(testCase.mPrefix)); in TestIp4Ip6Translation() 797 prefix.Set(address.GetBytes(), testCase.mLength); in TestIp4Ip6Translation() 799 SuccessOrQuit(expectedAddress.FromString(testCase.mIp6Address)); in TestIp4Ip6Translation() 804 … ip4Address.ToString().AsCString(), address.ToString().AsCString(), testCase.mIp6Address, in TestIp4Ip6Translation() [all …]
|
D | test_cmd_line_parser.cpp | 61 const TestCase<ValueType> *testCase = aTestCases; in VerifyParser() local 69 printf("%s(\"%s\") -> ", aParserName, testCase->mString); in VerifyParser() 71 if (testCase->mError != OT_ERROR_NONE) in VerifyParser() 73 printf("error:%s", otThreadErrorToString(testCase->mError)); in VerifyParser() 77 printf(aPrintFormat, testCase->mValue); in VerifyParser() 82 error = Parser(testCase->mString, value); in VerifyParser() 84 VerifyOrQuit(error == testCase->mError, "Parser did not return the expected error"); in VerifyParser() 88 VerifyOrQuit(value == testCase->mValue, "Parser failed"); in VerifyParser() 91 if (testCase->mString[0] == '\0') in VerifyParser() 96 testCase++; in VerifyParser()
|
D | test_string.cpp | 342 for (const TestCase &testCase : kTestCases) in TestStringParseUint8() local 344 const char *string = testCase.mString; in TestStringParseUint8() 350 VerifyOrQuit(error == testCase.mError); in TestStringParseUint8() 352 if (testCase.mError == kErrorNone) in TestStringParseUint8() 354 …printf("\n%-10s -> %-3u (expect: %-3u), len:%u (expect:%u)", testCase.mString, u8, testCase.mExpec… in TestStringParseUint8() 355 static_cast<uint8_t>(string - testCase.mString), testCase.mParsedLength); in TestStringParseUint8() 357 VerifyOrQuit(u8 == testCase.mExpectedValue); in TestStringParseUint8() 358 VerifyOrQuit(string - testCase.mString == testCase.mParsedLength); in TestStringParseUint8() 362 printf("\n%-10s -> kErrorParse", testCase.mString); in TestStringParseUint8()
|
D | test_mac_frame.cpp | 286 for (const TestCase &testCase : kTestCases) in TestMacHeader() local 304 switch (testCase.mSrcAddrType) in TestMacHeader() 317 switch (testCase.mDstAddrType) in TestMacHeader() 330 switch (testCase.mSrcPanIdMode) in TestMacHeader() 342 switch (testCase.mDstPanIdMode) in TestMacHeader() 354 …frame.InitMacHeader(Mac::Frame::kTypeData, testCase.mVersion, addresses, panIds, testCase.mSecurit… in TestMacHeader() 355 testCase.mKeyIdMode); in TestMacHeader() 357 VerifyOrQuit(frame.GetHeaderLength() == testCase.mHeaderLength); in TestMacHeader() 358 VerifyOrQuit(frame.GetFooterLength() == testCase.mFooterLength); in TestMacHeader() 359 VerifyOrQuit(frame.GetLength() == testCase.mHeaderLength + testCase.mFooterLength); in TestMacHeader() [all …]
|
D | test_mle.cpp | 163 for (const TestCase &testCase : kTestCases) in TestLeaderWeightCalculation() local 165 otThreadSetDeviceProperties(instance, &testCase.mDeviceProperties); in TestLeaderWeightCalculation() 166 … CompareDevicePropertiess(testCase.mDeviceProperties, *otThreadGetDeviceProperties(instance)); in TestLeaderWeightCalculation() 167 VerifyOrQuit(otThreadGetLocalLeaderWeight(instance) == testCase.mExpectedLeaderWeight); in TestLeaderWeightCalculation()
|