mirror of
https://github.com/espressif/openthread.git
synced 2026-10-18 05:28:10 +00:00
[clang-format] apply v14 changes (#8490)
This commit is contained in:
@@ -55,7 +55,7 @@ void TestMacBeaconFrame(void)
|
||||
0xAC, 0x02, 0x05, 0x00, 0x00, 0x00, 0x55, 0xCF, 0x00, 0x00, 0x51, 0x52,
|
||||
0x53, 0x54, 0x22, 0x3B, 0xC1, 0xEC, 0x84, 0x1A, 0xB5, 0x53};
|
||||
|
||||
otInstance * instance = testInitInstance();
|
||||
otInstance *instance = testInitInstance();
|
||||
ot::Crypto::AesCcm aesCcm;
|
||||
uint32_t headerLength = sizeof(test) - 8;
|
||||
uint32_t payloadLength = 0;
|
||||
@@ -122,8 +122,8 @@ void TestMacCommandFrame(void)
|
||||
|
||||
uint8_t tag[kTagLength];
|
||||
|
||||
ot::Instance * instance = testInitInstance();
|
||||
ot::Message * message;
|
||||
ot::Instance *instance = testInitInstance();
|
||||
ot::Message *message;
|
||||
ot::Crypto::AesCcm aesCcm;
|
||||
|
||||
VerifyOrQuit(instance != nullptr);
|
||||
@@ -195,9 +195,9 @@ void TestInPlaceAesCcmProcessing(void)
|
||||
uint8_t header[kHeaderLength];
|
||||
|
||||
ot::Crypto::AesCcm aesCcm;
|
||||
ot::Instance * instance = testInitInstance();
|
||||
ot::Message * message;
|
||||
ot::Message * messageClone;
|
||||
ot::Instance *instance = testInitInstance();
|
||||
ot::Message *message;
|
||||
ot::Message *messageClone;
|
||||
|
||||
VerifyOrQuit(instance != nullptr);
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ uint16_t CalculateChecksum(const void *aBuffer, uint16_t aLength)
|
||||
uint16_t CalculateChecksum(const Ip6::Address &aSource,
|
||||
const Ip6::Address &aDestination,
|
||||
uint8_t aIpProto,
|
||||
const Message & aMessage)
|
||||
const Message &aMessage)
|
||||
{
|
||||
// This method calculates the checksum over an IPv6 message.
|
||||
constexpr uint16_t kMaxPayload = 1024;
|
||||
@@ -112,7 +112,7 @@ uint16_t CalculateChecksum(const Ip6::Address &aSource,
|
||||
uint16_t CalculateChecksum(const Ip4::Address &aSource,
|
||||
const Ip4::Address &aDestination,
|
||||
uint8_t aIpProto,
|
||||
const Message & aMessage)
|
||||
const Message &aMessage)
|
||||
{
|
||||
// This method calculates the checksum over an IPv4 message.
|
||||
constexpr uint16_t kMaxPayload = 1024;
|
||||
@@ -181,7 +181,7 @@ void TestUdpMessageChecksum(void)
|
||||
|
||||
for (uint16_t size = kMinSize; size <= kMaxSize; size++)
|
||||
{
|
||||
Message * message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip6::Udp::Header));
|
||||
Message *message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip6::Udp::Header));
|
||||
Ip6::Udp::Header udpHeader;
|
||||
Ip6::MessageInfo messageInfo;
|
||||
|
||||
@@ -249,7 +249,7 @@ void TestIcmp6MessageChecksum(void)
|
||||
|
||||
for (uint16_t size = kMinSize; size <= kMaxSize; size++)
|
||||
{
|
||||
Message * message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip6::Icmp::Header));
|
||||
Message *message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip6::Icmp::Header));
|
||||
Ip6::Icmp::Header icmp6Header;
|
||||
Ip6::MessageInfo messageInfo;
|
||||
|
||||
@@ -324,7 +324,7 @@ void TestTcp4MessageChecksum(void)
|
||||
|
||||
for (uint16_t size = kMinSize; size <= kMaxSize; size++)
|
||||
{
|
||||
Message * message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip4::Tcp::Header));
|
||||
Message *message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip4::Tcp::Header));
|
||||
Ip4::Tcp::Header tcpHeader;
|
||||
|
||||
VerifyOrQuit(message != nullptr, "Ip6::NewMesssage() failed");
|
||||
@@ -379,7 +379,7 @@ void TestUdp4MessageChecksum(void)
|
||||
|
||||
for (uint16_t size = kMinSize; size <= kMaxSize; size++)
|
||||
{
|
||||
Message * message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip4::Udp::Header));
|
||||
Message *message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip4::Udp::Header));
|
||||
Ip4::Udp::Header udpHeader;
|
||||
|
||||
VerifyOrQuit(message != nullptr, "Ip6::NewMesssage() failed");
|
||||
@@ -418,13 +418,13 @@ void TestUdp4MessageChecksum(void)
|
||||
void TestIcmp4MessageChecksum(void)
|
||||
{
|
||||
// A captured ICMP echo request (ping) message. Checksum field is set to zero.
|
||||
const uint8_t kExampleIcmpMessage[] = "\x08\x00\x00\x00\x67\x2e\x00\x00\x62\xaf\xf1\x61\x00\x04\xfc\x24"
|
||||
"\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17"
|
||||
"\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27"
|
||||
"\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37";
|
||||
uint16_t kChecksumForExampleMessage = 0x5594;
|
||||
Instance *instance = static_cast<Instance *>(testInitInstance());
|
||||
Message * message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(kExampleIcmpMessage));
|
||||
const uint8_t kExampleIcmpMessage[] = "\x08\x00\x00\x00\x67\x2e\x00\x00\x62\xaf\xf1\x61\x00\x04\xfc\x24"
|
||||
"\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17"
|
||||
"\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27"
|
||||
"\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37";
|
||||
uint16_t kChecksumForExampleMessage = 0x5594;
|
||||
Instance *instance = static_cast<Instance *>(testInitInstance());
|
||||
Message *message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(kExampleIcmpMessage));
|
||||
|
||||
Ip4::Address source;
|
||||
Ip4::Address dest;
|
||||
|
||||
@@ -191,10 +191,10 @@ void TestChildIp6Address(void)
|
||||
Child child;
|
||||
Ip6::Address addresses[kMaxChildIp6Addresses];
|
||||
uint8_t numAddresses;
|
||||
const char * ip6Addresses[] = {
|
||||
"fd00:1234::1234",
|
||||
"ff6b:e251:52fb:0:12e6:b94c:1c28:c56a",
|
||||
"fd00:1234::204c:3d7c:98f6:9a1b",
|
||||
const char *ip6Addresses[] = {
|
||||
"fd00:1234::1234",
|
||||
"ff6b:e251:52fb:0:12e6:b94c:1c28:c56a",
|
||||
"fd00:1234::204c:3d7c:98f6:9a1b",
|
||||
};
|
||||
|
||||
const uint8_t meshLocalIidArray[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88};
|
||||
|
||||
@@ -124,7 +124,7 @@ void VerifyChildTableContent(ChildTable &aTable, uint16_t aChildListLength, cons
|
||||
|
||||
for (uint16_t listIndex = 0; listIndex < aChildListLength; listIndex++)
|
||||
{
|
||||
Child * child;
|
||||
Child *child;
|
||||
Mac::Address address;
|
||||
|
||||
if (!StateMatchesFilter(aChildList[listIndex].mState, filter))
|
||||
@@ -164,8 +164,8 @@ void VerifyChildTableContent(ChildTable &aTable, uint16_t aChildListLength, cons
|
||||
|
||||
for (; !iter.IsDone(); iter++)
|
||||
{
|
||||
Child * child = iter.GetChild();
|
||||
Child & childRef = *iter;
|
||||
Child *child = iter.GetChild();
|
||||
Child &childRef = *iter;
|
||||
bool didFind = false;
|
||||
uint16_t childIndex;
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ void TestParsingHexStrings(void)
|
||||
uint8_t buffer[sizeof(kEvenParsedArray)];
|
||||
uint8_t buf3[3];
|
||||
uint16_t len;
|
||||
const char * string;
|
||||
const char *string;
|
||||
const uint8_t *bufPtr;
|
||||
|
||||
// Verify `ParseAsHexString(const char *aString, uint8_t *aBuffer, uint16_t aSize)`
|
||||
|
||||
+16
-16
@@ -49,24 +49,24 @@ void TestDnsName(void)
|
||||
|
||||
struct TestName
|
||||
{
|
||||
const char * mName;
|
||||
const char *mName;
|
||||
uint16_t mEncodedLength;
|
||||
const uint8_t *mEncodedData;
|
||||
const char ** mLabels;
|
||||
const char * mExpectedReadName;
|
||||
const char **mLabels;
|
||||
const char *mExpectedReadName;
|
||||
};
|
||||
|
||||
Instance * instance;
|
||||
Instance *instance;
|
||||
MessagePool *messagePool;
|
||||
Message * message;
|
||||
Message *message;
|
||||
uint8_t buffer[kMaxSize];
|
||||
uint16_t len;
|
||||
uint16_t offset;
|
||||
char label[Dns::Name::kMaxLabelSize];
|
||||
uint8_t labelLength;
|
||||
char name[Dns::Name::kMaxNameSize];
|
||||
const char * subDomain;
|
||||
const char * domain;
|
||||
const char *subDomain;
|
||||
const char *domain;
|
||||
|
||||
static const uint8_t kEncodedName1[] = {7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'c', 'o', 'm', 0};
|
||||
static const uint8_t kEncodedName2[] = {3, 'f', 'o', 'o', 1, 'a', 2, 'b', 'b', 3, 'e', 'd', 'u', 0};
|
||||
@@ -444,10 +444,10 @@ void TestDnsCompressedName(void)
|
||||
|
||||
static const char kBadName[] = "bad.name";
|
||||
|
||||
Instance * instance;
|
||||
Instance *instance;
|
||||
MessagePool *messagePool;
|
||||
Message * message;
|
||||
Message * message2;
|
||||
Message *message;
|
||||
Message *message2;
|
||||
uint16_t offset;
|
||||
uint16_t name1Offset;
|
||||
uint16_t name2Offset;
|
||||
@@ -799,9 +799,9 @@ void TestHeaderAndResourceRecords(void)
|
||||
const char *kInstanceLabels[] = {kInstance1Label, kInstance2Label};
|
||||
const char *kInstanceNames[] = {kInstance1Name, kInstance2Name};
|
||||
|
||||
Instance * instance;
|
||||
MessagePool * messagePool;
|
||||
Message * message;
|
||||
Instance *instance;
|
||||
MessagePool *messagePool;
|
||||
Message *message;
|
||||
Dns::Header header;
|
||||
uint16_t messageId;
|
||||
uint16_t headerOffset;
|
||||
@@ -1240,9 +1240,9 @@ void TestDnsTxtEntry(void)
|
||||
{kEncodedTxt5, sizeof(kEncodedTxt5)}, {kEncodedTxt6, sizeof(kEncodedTxt6)},
|
||||
{kEncodedTxt7, sizeof(kEncodedTxt7)}};
|
||||
|
||||
Instance * instance;
|
||||
MessagePool * messagePool;
|
||||
Message * message;
|
||||
Instance *instance;
|
||||
MessagePool *messagePool;
|
||||
Message *message;
|
||||
uint8_t txtData[kMaxTxtDataSize];
|
||||
uint16_t txtDataLength;
|
||||
uint8_t index;
|
||||
|
||||
+13
-13
@@ -118,8 +118,8 @@ class Connection : public Dso::Connection
|
||||
friend void otPlatDsoSend(otPlatDsoConnection *aConnection, otMessage *aMessage);
|
||||
|
||||
public:
|
||||
explicit Connection(Instance & aInstance,
|
||||
const char * aName,
|
||||
explicit Connection(Instance &aInstance,
|
||||
const char *aName,
|
||||
const Ip6::SockAddr &aLocalSockAddr,
|
||||
const Ip6::SockAddr &aPeerSockAddr)
|
||||
: Dso::Connection(aInstance, aPeerSockAddr, sCallbacks)
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
ClearTestFlags();
|
||||
}
|
||||
|
||||
const char * GetName(void) const { return mName; }
|
||||
const char *GetName(void) const { return mName; }
|
||||
const Ip6::SockAddr &GetLocalSockAddr(void) const { return mLocalSockAddr; }
|
||||
|
||||
void ClearTestFlags(void)
|
||||
@@ -247,7 +247,7 @@ private:
|
||||
}
|
||||
|
||||
Error ProcessResponseMessage(const Dns::Header &aHeader,
|
||||
const Message & aMessage,
|
||||
const Message &aMessage,
|
||||
Dso::Tlv::Type aResponseTlvType,
|
||||
Dso::Tlv::Type aRequestTlvType)
|
||||
{
|
||||
@@ -289,22 +289,22 @@ private:
|
||||
|
||||
static Error ProcessRequestMessage(Dso::Connection &aConnection,
|
||||
MessageId aMessageId,
|
||||
const Message & aMessage,
|
||||
const Message &aMessage,
|
||||
Dso::Tlv::Type aPrimaryTlvType)
|
||||
{
|
||||
return static_cast<Connection &>(aConnection).ProcessRequestMessage(aMessageId, aMessage, aPrimaryTlvType);
|
||||
}
|
||||
|
||||
static Error ProcessUnidirectionalMessage(Dso::Connection &aConnection,
|
||||
const Message & aMessage,
|
||||
const Message &aMessage,
|
||||
Dso::Tlv::Type aPrimaryTlvType)
|
||||
{
|
||||
return static_cast<Connection &>(aConnection).ProcessUnidirectionalMessage(aMessage, aPrimaryTlvType);
|
||||
}
|
||||
|
||||
static Error ProcessResponseMessage(Dso::Connection & aConnection,
|
||||
static Error ProcessResponseMessage(Dso::Connection &aConnection,
|
||||
const Dns::Header &aHeader,
|
||||
const Message & aMessage,
|
||||
const Message &aMessage,
|
||||
Dso::Tlv::Type aResponseTlvType,
|
||||
Dso::Tlv::Type aRequestTlvType)
|
||||
{
|
||||
@@ -312,7 +312,7 @@ private:
|
||||
.ProcessResponseMessage(aHeader, aMessage, aResponseTlvType, aRequestTlvType);
|
||||
}
|
||||
|
||||
const char * mName;
|
||||
const char *mName;
|
||||
Ip6::SockAddr mLocalSockAddr;
|
||||
bool mDidGetConnectedSignal;
|
||||
bool mDidGetSessionEstablishedSignal;
|
||||
@@ -380,8 +380,8 @@ void otPlatDsoEnableListening(otInstance *, bool aEnable)
|
||||
|
||||
void otPlatDsoConnect(otPlatDsoConnection *aConnection, const otSockAddr *aPeerSockAddr)
|
||||
{
|
||||
Connection & conn = *static_cast<Connection *>(aConnection);
|
||||
Connection * peerConn = nullptr;
|
||||
Connection &conn = *static_cast<Connection *>(aConnection);
|
||||
Connection *peerConn = nullptr;
|
||||
const Ip6::SockAddr &peerSockAddr = AsCoreType(aPeerSockAddr);
|
||||
|
||||
Log(" otPlatDsoConnect(%s, aPeer:0x%04x)", conn.GetName(), peerSockAddr.GetPort());
|
||||
@@ -545,12 +545,12 @@ void TestDso(void)
|
||||
static constexpr uint32_t kRetryDelayInterval = TimeMilli::SecToMsec(3600);
|
||||
static constexpr uint32_t kLongResponseTimeout = Dso::kResponseTimeout + TimeMilli::SecToMsec(17);
|
||||
|
||||
Instance & instance = *static_cast<Instance *>(testInitInstance());
|
||||
Instance &instance = *static_cast<Instance *>(testInitInstance());
|
||||
Ip6::SockAddr serverSockAddr(kPortA);
|
||||
Ip6::SockAddr clientSockAddr(kPortB);
|
||||
Connection serverConn(instance, "serverConn", serverSockAddr, clientSockAddr);
|
||||
Connection clientConn(instance, "clinetConn", clientSockAddr, serverSockAddr);
|
||||
Message * message;
|
||||
Message *message;
|
||||
Dso::Tlv tlv;
|
||||
Connection::MessageId messageId;
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ void TestFrameBuilder(void)
|
||||
|
||||
static constexpr uint16_t kMaxBufferSize = sizeof(kData1) * 2 + sizeof(kData2);
|
||||
|
||||
Instance * instance;
|
||||
Message * message;
|
||||
Instance *instance;
|
||||
Message *message;
|
||||
uint16_t offset;
|
||||
uint8_t buffer[kMaxBufferSize];
|
||||
uint8_t zeroBuffer[kMaxBufferSize];
|
||||
|
||||
@@ -58,7 +58,7 @@ static const uint8_t sMottoText[] = "Think good thoughts, say good words, d
|
||||
static const uint8_t sHexText[] = "0123456789abcdef";
|
||||
static const uint8_t sSkipText[] = "Skip text";
|
||||
static const uint8_t sHdlcSpecials[] = {kFlagSequence, kFlagXOn, kFlagXOff,
|
||||
kFlagSequence, kEscapeSequence, kFlagSpecial};
|
||||
kFlagSequence, kEscapeSequence, kFlagSpecial};
|
||||
|
||||
otError WriteToBuffer(const uint8_t *aText, Hdlc::FrameWritePointer &aWritePointer)
|
||||
{
|
||||
@@ -126,8 +126,8 @@ void TestHdlcFrameBuffer(void)
|
||||
void TestHdlcMultiFrameBuffer(void)
|
||||
{
|
||||
Hdlc::MultiFrameBuffer<kBufferSize> frameBuffer;
|
||||
uint8_t * frame = nullptr;
|
||||
uint8_t * newFrame = nullptr;
|
||||
uint8_t *frame = nullptr;
|
||||
uint8_t *newFrame = nullptr;
|
||||
uint16_t length;
|
||||
uint16_t newLength;
|
||||
|
||||
@@ -454,7 +454,7 @@ void TestEncoderDecoder(void)
|
||||
DecoderContext decoderContext;
|
||||
Hdlc::Encoder encoder(encoderBuffer);
|
||||
Hdlc::Decoder decoder(decoderBuffer, ProcessDecodedFrame, &decoderContext);
|
||||
uint8_t * frame;
|
||||
uint8_t *frame;
|
||||
uint16_t length;
|
||||
uint8_t badShortFrame[3] = {kFlagSequence, 0xaa, kFlagSequence};
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ void TestAllocateRandomly(size_t aSizeLimit, unsigned int aSeed)
|
||||
{
|
||||
struct Node
|
||||
{
|
||||
Node * mNext;
|
||||
Node *mNext;
|
||||
size_t mSize;
|
||||
};
|
||||
|
||||
@@ -93,7 +93,7 @@ void TestAllocateRandomly(size_t aSizeLimit, unsigned int aSeed)
|
||||
srand(aSeed);
|
||||
|
||||
const size_t totalSize = heap.GetFreeSize();
|
||||
Node * last = &head;
|
||||
Node *last = &head;
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
@@ -182,7 +182,7 @@ void TestHeapArrayOfUint16(void)
|
||||
{
|
||||
Heap::Array<uint16_t, 2> array;
|
||||
Heap::Array<uint16_t, 2> array2;
|
||||
uint16_t * entry;
|
||||
uint16_t *entry;
|
||||
|
||||
printf("\n\n====================================================================================\n");
|
||||
printf("TestHeapArrayOfUint16\n\n");
|
||||
@@ -348,7 +348,7 @@ void TestHeapArray(void)
|
||||
{
|
||||
Heap::Array<Entry, 2> array;
|
||||
Heap::Array<Entry, 2> array2;
|
||||
Entry * entry;
|
||||
Entry *entry;
|
||||
|
||||
printf("------------------------------------------------------------------------------------\n");
|
||||
printf("After constructor\n");
|
||||
|
||||
@@ -86,7 +86,7 @@ void TestHeapString(void)
|
||||
{
|
||||
Heap::String str1;
|
||||
Heap::String str2;
|
||||
const char * oldBuffer;
|
||||
const char *oldBuffer;
|
||||
|
||||
printf("====================================================================================\n");
|
||||
printf("TestHeapString\n\n");
|
||||
@@ -199,9 +199,9 @@ template <uint16_t kLength> void VerifyData(const Heap::Data &aData, const uint8
|
||||
|
||||
void TestHeapData(void)
|
||||
{
|
||||
Instance * instance;
|
||||
MessagePool * messagePool;
|
||||
Message * message;
|
||||
Instance *instance;
|
||||
MessagePool *messagePool;
|
||||
Message *message;
|
||||
Heap::Data data;
|
||||
uint16_t offset;
|
||||
const uint8_t *oldBuffer;
|
||||
|
||||
@@ -59,7 +59,7 @@ void TestHkdfSha256(void)
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// Test Case #1: RFC-5869 Appendix A.1
|
||||
const uint8_t kInKey1[] = {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
|
||||
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b};
|
||||
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b};
|
||||
const uint8_t kSalt1[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c};
|
||||
const uint8_t kInfo1[] = {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9};
|
||||
const uint8_t kOutKey1[] = {0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, 0x90, 0x43, 0x4f, 0x64, 0xd0, 0x36,
|
||||
|
||||
@@ -72,7 +72,7 @@ void TestSha256(void)
|
||||
|
||||
struct TestCase
|
||||
{
|
||||
const char * mData; // (null-terminated string).
|
||||
const char *mData; // (null-terminated string).
|
||||
otCryptoSha256Hash mHash;
|
||||
};
|
||||
|
||||
@@ -85,9 +85,9 @@ void TestSha256(void)
|
||||
|
||||
printf("TestSha256\n");
|
||||
|
||||
Instance * instance = testInitInstance();
|
||||
Instance *instance = testInitInstance();
|
||||
MessagePool *messagePool;
|
||||
Message * message;
|
||||
Message *message;
|
||||
uint16_t offsets[GetArrayLength(kTestCases)];
|
||||
uint8_t index;
|
||||
|
||||
@@ -142,7 +142,7 @@ void TestHmacSha256(void)
|
||||
struct TestCase
|
||||
{
|
||||
otCryptoKey mKey;
|
||||
const void * mData;
|
||||
const void *mData;
|
||||
uint16_t mDataLength;
|
||||
otCryptoSha256Hash mHash;
|
||||
};
|
||||
@@ -226,9 +226,9 @@ void TestHmacSha256(void)
|
||||
{{&kKey5[0], sizeof(kKey5), 0}, kData5, sizeof(kData5) - 1, kHash5},
|
||||
};
|
||||
|
||||
Instance * instance = testInitInstance();
|
||||
Instance *instance = testInitInstance();
|
||||
MessagePool *messagePool;
|
||||
Message * message;
|
||||
Message *message;
|
||||
uint16_t offsets[GetArrayLength(kTestCases)];
|
||||
uint8_t index;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
template <typename AddressType> struct TestVector
|
||||
{
|
||||
const char * mString;
|
||||
const char *mString;
|
||||
const uint8_t mAddr[sizeof(AddressType)];
|
||||
ot::Error mError;
|
||||
};
|
||||
@@ -529,10 +529,10 @@ void TestIp4Cidr(void)
|
||||
using ot::Encoding::BigEndian::HostSwap32;
|
||||
struct TestCase
|
||||
{
|
||||
const char * mNetwork;
|
||||
const char *mNetwork;
|
||||
const uint8_t mLength;
|
||||
const uint32_t mHost;
|
||||
const char * mOutcome;
|
||||
const char *mOutcome;
|
||||
};
|
||||
|
||||
const TestCase kTestCases[] = {
|
||||
|
||||
@@ -339,30 +339,30 @@ void TestLinkQualityCalculations(void)
|
||||
{
|
||||
const int8_t rssList1[] = {-81, -80, -79, -78, -76, -80, -77, -75, -77, -76, -77, -74};
|
||||
const RssTestData rssData1 = {
|
||||
rssList1, // mRssList
|
||||
sizeof(rssList1), // mRssListSize
|
||||
3 // mExpectedLinkQuality
|
||||
rssList1, // mRssList
|
||||
sizeof(rssList1), // mRssListSize
|
||||
3 // mExpectedLinkQuality
|
||||
};
|
||||
|
||||
const int8_t rssList2[] = {-90, -80, -85};
|
||||
const RssTestData rssData2 = {
|
||||
rssList2, // mRssList
|
||||
sizeof(rssList2), // mRssListSize
|
||||
2 // mExpectedLinkQuality
|
||||
rssList2, // mRssList
|
||||
sizeof(rssList2), // mRssListSize
|
||||
2 // mExpectedLinkQuality
|
||||
};
|
||||
|
||||
const int8_t rssList3[] = {-95, -96, -98, -99, -100, -100, -98, -99, -100, -100, -100, -100, -100};
|
||||
const RssTestData rssData3 = {
|
||||
rssList3, // mRssList
|
||||
sizeof(rssList3), // mRssListSize
|
||||
0 // mExpectedLinkQuality
|
||||
rssList3, // mRssList
|
||||
sizeof(rssList3), // mRssListSize
|
||||
0 // mExpectedLinkQuality
|
||||
};
|
||||
|
||||
const int8_t rssList4[] = {-75, -100, -100, -100, -100, -100, -95, -92, -93, -94, -93, -93};
|
||||
const RssTestData rssData4 = {
|
||||
rssList4, // mRssList
|
||||
sizeof(rssList4), // mRssListSize
|
||||
1 // mExpectedLinkQuality
|
||||
rssList4, // mRssList
|
||||
sizeof(rssList4), // mRssListSize
|
||||
1 // mExpectedLinkQuality
|
||||
};
|
||||
|
||||
TestLinkQualityData(rssData1);
|
||||
|
||||
@@ -88,8 +88,8 @@ constexpr Entry::Type kBetaType = Entry::Type::kBeta;
|
||||
void VerifyLinkedListContent(const LinkedList<Entry> *aList, ...)
|
||||
{
|
||||
va_list args;
|
||||
Entry * argEntry;
|
||||
Entry * argPrev = nullptr;
|
||||
Entry *argEntry;
|
||||
Entry *argPrev = nullptr;
|
||||
const Entry *prev;
|
||||
uint16_t unusedId = 100;
|
||||
|
||||
@@ -134,7 +134,7 @@ void TestLinkedList(void)
|
||||
{
|
||||
Entry a("a", 1, kAlphaType), b("b", 2, kAlphaType), c("c", 3, kBetaType);
|
||||
Entry d("d", 4, kBetaType), e("e", 5, kAlphaType), f("f", 6, kBetaType);
|
||||
Entry * prev;
|
||||
Entry *prev;
|
||||
LinkedList<Entry> list;
|
||||
LinkedList<Entry> removedList;
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ using namespace ot;
|
||||
|
||||
namespace ot {
|
||||
|
||||
ot::Instance * sInstance;
|
||||
Ip6::Ip6 * sIp6;
|
||||
ot::Instance *sInstance;
|
||||
Ip6::Ip6 *sIp6;
|
||||
Lowpan::Lowpan *sLowpan;
|
||||
|
||||
void TestIphcVector::GetCompressedStream(uint8_t *aIphc, uint16_t &aIphcLength)
|
||||
@@ -146,7 +146,7 @@ static void Init(void)
|
||||
*/
|
||||
static void Test(TestIphcVector &aVector, bool aCompress, bool aDecompress)
|
||||
{
|
||||
Message * message = nullptr;
|
||||
Message *message = nullptr;
|
||||
uint8_t result[512];
|
||||
uint8_t iphc[512];
|
||||
uint8_t ip6[512];
|
||||
@@ -173,7 +173,7 @@ static void Test(TestIphcVector &aVector, bool aCompress, bool aDecompress)
|
||||
if (aCompress)
|
||||
{
|
||||
FrameBuilder frameBuilder;
|
||||
Message * compressedMsg;
|
||||
Message *compressedMsg;
|
||||
Ip6::Ecn ecn;
|
||||
|
||||
frameBuilder.Init(result, 127);
|
||||
|
||||
@@ -58,7 +58,7 @@ void TestMacAddress(void)
|
||||
const uint8_t kExtAddr[OT_EXT_ADDRESS_SIZE] = {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0};
|
||||
const Mac::ShortAddress kShortAddr = 0x1234;
|
||||
|
||||
ot::Instance * instance;
|
||||
ot::Instance *instance;
|
||||
Mac::Address addr;
|
||||
Mac::ExtAddress extAddr;
|
||||
uint8_t buffer[OT_EXT_ADDRESS_SIZE];
|
||||
@@ -358,7 +358,7 @@ void TestMacFrameApi(void)
|
||||
|
||||
#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
|
||||
uint8_t data_psdu1[] = {0x29, 0xee, 0x53, 0xce, 0xfa, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x6e, 0x16, 0x05,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0a, 0x6e, 0x16, 0x0d, 0x01, 0x00, 0x00, 0x00, 0x01};
|
||||
0x00, 0x00, 0x00, 0x00, 0x0a, 0x6e, 0x16, 0x0d, 0x01, 0x00, 0x00, 0x00, 0x01};
|
||||
uint8_t mac_cmd_psdu2[] = {0x6b, 0xaa, 0x8d, 0xce, 0xfa, 0x00, 0x68, 0x01, 0x68, 0x0d,
|
||||
0x08, 0x00, 0x00, 0x00, 0x01, 0x04, 0x0d, 0xed, 0x0b, 0x35,
|
||||
0x0c, 0x80, 0x3f, 0x04, 0x4b, 0x88, 0x89, 0xd6, 0x59, 0xe1};
|
||||
@@ -477,12 +477,12 @@ void TestMacFrameAckGeneration(void)
|
||||
// Destination: 16:6e:0a:00:00:00:00:01 (16:6e:0a:00:00:00:00:01)
|
||||
// Extended Source: 16:6e:0a:00:00:00:00:02 (16:6e:0a:00:00:00:00:02)
|
||||
uint8_t data_psdu1[] = {0x61, 0xdc, 0xbd, 0xce, 0xfa, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x6e, 0x16, 0x02,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0a, 0x6e, 0x16, 0x7f, 0x33, 0xf0, 0x4d, 0x4c, 0x4d, 0x4c,
|
||||
0x8b, 0xf0, 0x00, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc2,
|
||||
0x57, 0x9c, 0x31, 0xb3, 0x2a, 0xa1, 0x86, 0xba, 0x9a, 0xed, 0x5a, 0xb9, 0xa3, 0x59,
|
||||
0x88, 0xeb, 0xbb, 0x0d, 0xc3, 0xed, 0xeb, 0x8a, 0x53, 0xa6, 0xed, 0xf7, 0xdd, 0x45,
|
||||
0x6e, 0xf7, 0x9a, 0x17, 0xb4, 0xab, 0xc6, 0x75, 0x71, 0x46, 0x37, 0x93, 0x4a, 0x32,
|
||||
0xb1, 0x21, 0x9f, 0x9d, 0xb3, 0x65, 0x27, 0xd5, 0xfc, 0x50, 0x16, 0x90, 0xd2, 0xd4};
|
||||
0x00, 0x00, 0x00, 0x00, 0x0a, 0x6e, 0x16, 0x7f, 0x33, 0xf0, 0x4d, 0x4c, 0x4d, 0x4c,
|
||||
0x8b, 0xf0, 0x00, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc2,
|
||||
0x57, 0x9c, 0x31, 0xb3, 0x2a, 0xa1, 0x86, 0xba, 0x9a, 0xed, 0x5a, 0xb9, 0xa3, 0x59,
|
||||
0x88, 0xeb, 0xbb, 0x0d, 0xc3, 0xed, 0xeb, 0x8a, 0x53, 0xa6, 0xed, 0xf7, 0xdd, 0x45,
|
||||
0x6e, 0xf7, 0x9a, 0x17, 0xb4, 0xab, 0xc6, 0x75, 0x71, 0x46, 0x37, 0x93, 0x4a, 0x32,
|
||||
0xb1, 0x21, 0x9f, 0x9d, 0xb3, 0x65, 0x27, 0xd5, 0xfc, 0x50, 0x16, 0x90, 0xd2, 0xd4};
|
||||
receivedFrame.mPsdu = data_psdu1;
|
||||
receivedFrame.mLength = sizeof(data_psdu1);
|
||||
|
||||
@@ -537,8 +537,8 @@ void TestMacFrameAckGeneration(void)
|
||||
// [Key Number: 0]
|
||||
// FCS: 0x8c40 (Correct)
|
||||
uint8_t data_psdu2[] = {0x69, 0xa8, 0x8e, 0xce, 0xfa, 0x02, 0x24, 0x00, 0x24, 0x0d, 0x02,
|
||||
0x00, 0x00, 0x00, 0x01, 0x6b, 0x64, 0x60, 0x08, 0x55, 0xb8, 0x10,
|
||||
0x18, 0xc7, 0x40, 0x2e, 0xfb, 0xf3, 0xda, 0xf9, 0x4e, 0x58, 0x70};
|
||||
0x00, 0x00, 0x00, 0x01, 0x6b, 0x64, 0x60, 0x08, 0x55, 0xb8, 0x10,
|
||||
0x18, 0xc7, 0x40, 0x2e, 0xfb, 0xf3, 0xda, 0xf9, 0x4e, 0x58, 0x70};
|
||||
receivedFrame.mPsdu = data_psdu2;
|
||||
receivedFrame.mLength = sizeof(data_psdu2);
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ void TestMessage(void)
|
||||
kLengthStep = 21,
|
||||
};
|
||||
|
||||
Instance * instance;
|
||||
Instance *instance;
|
||||
MessagePool *messagePool;
|
||||
Message * message;
|
||||
Message * message2;
|
||||
Message *message;
|
||||
Message *message2;
|
||||
uint8_t writeBuffer[kMaxSize];
|
||||
uint8_t readBuffer[kMaxSize];
|
||||
uint8_t zeroBuffer[kMaxSize];
|
||||
@@ -246,8 +246,8 @@ void TestAppender(void)
|
||||
|
||||
static constexpr uint16_t kMaxBufferSize = sizeof(kData1) * 2 + sizeof(kData2);
|
||||
|
||||
Instance * instance;
|
||||
Message * message;
|
||||
Instance *instance;
|
||||
Message *message;
|
||||
uint8_t buffer[kMaxBufferSize];
|
||||
uint8_t zeroBuffer[kMaxBufferSize];
|
||||
Appender bufAppender(buffer, sizeof(buffer));
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#define kNumTestMessages 5
|
||||
|
||||
static ot::Instance * sInstance;
|
||||
static ot::Instance *sInstance;
|
||||
static ot::MessagePool *sMessagePool;
|
||||
|
||||
// This function verifies the content of the message queue to match the passed in messages
|
||||
@@ -48,8 +48,8 @@ void VerifyMessageQueueContent(ot::MessageQueue &aMessageQueue, int aExpectedLen
|
||||
{
|
||||
const ot::MessageQueue &constQueue = aMessageQueue;
|
||||
va_list args;
|
||||
ot::Message * message;
|
||||
ot::Message * msgArg;
|
||||
ot::Message *message;
|
||||
ot::Message *msgArg;
|
||||
|
||||
va_start(args, aExpectedLength);
|
||||
|
||||
@@ -103,7 +103,7 @@ void VerifyMessageQueueContent(ot::MessageQueue &aMessageQueue, int aExpectedLen
|
||||
void TestMessageQueue(void)
|
||||
{
|
||||
ot::MessageQueue messageQueue;
|
||||
ot::Message * messages[kNumTestMessages];
|
||||
ot::Message *messages[kNumTestMessages];
|
||||
ot::MessageQueue::Info info;
|
||||
|
||||
sInstance = testInitInstance();
|
||||
@@ -280,8 +280,8 @@ void VerifyMessageQueueContentUsingOtApi(otMessageQueue *aQueue, int aExpectedLe
|
||||
// This test checks all the OpenThread C APIs for `otMessageQueue`
|
||||
void TestMessageQueueOtApis(void)
|
||||
{
|
||||
otMessage * messages[kNumTestMessages];
|
||||
otMessage * message;
|
||||
otMessage *messages[kNumTestMessages];
|
||||
otMessage *message;
|
||||
otMessageQueue queue, queue2;
|
||||
|
||||
sInstance = testInitInstance();
|
||||
|
||||
@@ -91,7 +91,7 @@ template <size_t N>
|
||||
void TestCase6To4(const char *aTestName,
|
||||
const uint8_t (&aIp6Message)[N],
|
||||
Nat64::Translator::Result aResult,
|
||||
const uint8_t * aOutMessage,
|
||||
const uint8_t *aOutMessage,
|
||||
size_t aOutMessageLen)
|
||||
{
|
||||
Message *msg = sInstance->Get<Ip6::Ip6>().NewMessage(0);
|
||||
@@ -118,7 +118,7 @@ template <size_t N>
|
||||
void TestCase4To6(const char *aTestName,
|
||||
const uint8_t (&aIp4Message)[N],
|
||||
Nat64::Translator::Result aResult,
|
||||
const uint8_t * aOutMessage,
|
||||
const uint8_t *aOutMessage,
|
||||
size_t aOutMessageLen)
|
||||
{
|
||||
Message *msg = sInstance->Get<Ip6::Ip6>().NewMessage(0);
|
||||
|
||||
@@ -89,7 +89,7 @@ void TestNetifMulticastAddresses(void)
|
||||
{
|
||||
const uint8_t kMaxAddresses = 8;
|
||||
|
||||
Instance * instance = testInitInstance();
|
||||
Instance *instance = testInitInstance();
|
||||
TestNetif netif(*instance);
|
||||
Ip6::Address addresses[kMaxAddresses];
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ void TestNetworkDataIterator(void)
|
||||
{
|
||||
static constexpr uint8_t kMaxRlocsArray = 10;
|
||||
|
||||
ot::Instance * instance;
|
||||
ot::Instance *instance;
|
||||
Iterator iter = kIteratorInit;
|
||||
ExternalRouteConfig rconfig;
|
||||
OnMeshPrefixConfig pconfig;
|
||||
@@ -639,7 +639,7 @@ void TestNetworkDataDsnSrpServices(void)
|
||||
|
||||
struct UnicastEntry
|
||||
{
|
||||
const char * mAddress;
|
||||
const char *mAddress;
|
||||
uint16_t mPort;
|
||||
Service::DnsSrpUnicast::Origin mOrigin;
|
||||
uint16_t mRloc16;
|
||||
@@ -681,7 +681,7 @@ void TestNetworkDataDsnSrpServices(void)
|
||||
|
||||
const uint8_t kPreferredAnycastEntryIndex = 2;
|
||||
|
||||
Service::Manager & manager = instance->Get<Service::Manager>();
|
||||
Service::Manager &manager = instance->Get<Service::Manager>();
|
||||
Service::Manager::Iterator iterator;
|
||||
Service::DnsSrpAnycast::Info anycastInfo;
|
||||
Service::DnsSrpUnicast::Info unicastInfo;
|
||||
|
||||
@@ -250,7 +250,7 @@ OT_TOOL_WEAK otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
|
||||
#if __SANITIZE_ADDRESS__ == 0
|
||||
{
|
||||
FILE * file = nullptr;
|
||||
FILE *file = nullptr;
|
||||
size_t readLength;
|
||||
|
||||
file = fopen("/dev/urandom", "rb");
|
||||
@@ -512,12 +512,12 @@ OT_TOOL_WEAK otError otPlatInfraIfDiscoverNat64Prefix(uint32_t)
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
|
||||
|
||||
otError otPlatCryptoImportKey(otCryptoKeyRef * aKeyRef,
|
||||
otError otPlatCryptoImportKey(otCryptoKeyRef *aKeyRef,
|
||||
otCryptoKeyType aKeyType,
|
||||
otCryptoKeyAlgorithm aKeyAlgorithm,
|
||||
int aKeyUsage,
|
||||
otCryptoKeyStorage aKeyPersistence,
|
||||
const uint8_t * aKey,
|
||||
const uint8_t *aKey,
|
||||
size_t aKeyLen)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aKeyRef);
|
||||
|
||||
@@ -44,8 +44,8 @@ void VerifyPriorityQueueContent(ot::PriorityQueue &aPriorityQueue, int aExpected
|
||||
{
|
||||
const ot::PriorityQueue &constQueue = aPriorityQueue;
|
||||
va_list args;
|
||||
ot::Message * message;
|
||||
ot::Message * msgArg;
|
||||
ot::Message *message;
|
||||
ot::Message *msgArg;
|
||||
int8_t curPriority = ot::Message::kNumPriorities;
|
||||
ot::PriorityQueue::Info info;
|
||||
|
||||
@@ -168,14 +168,14 @@ void VerifyMsgQueueContent(ot::MessageQueue &aMessageQueue, int aExpectedLength,
|
||||
|
||||
void TestPriorityQueue(void)
|
||||
{
|
||||
ot::Instance * instance;
|
||||
ot::MessagePool * messagePool;
|
||||
ot::Instance *instance;
|
||||
ot::MessagePool *messagePool;
|
||||
ot::PriorityQueue queue;
|
||||
ot::MessageQueue messageQueue;
|
||||
ot::Message * msgNet[kNumTestMessages];
|
||||
ot::Message * msgHigh[kNumTestMessages];
|
||||
ot::Message * msgNor[kNumTestMessages];
|
||||
ot::Message * msgLow[kNumTestMessages];
|
||||
ot::Message *msgNet[kNumTestMessages];
|
||||
ot::Message *msgHigh[kNumTestMessages];
|
||||
ot::Message *msgNor[kNumTestMessages];
|
||||
ot::Message *msgLow[kNumTestMessages];
|
||||
|
||||
instance = testInitInstance();
|
||||
VerifyOrQuit(instance != nullptr, "Null OpenThread instance");
|
||||
|
||||
+19
-19
@@ -39,10 +39,10 @@ void TestMinimumPassphrase(void)
|
||||
{
|
||||
ot::Pskc pskc;
|
||||
const uint8_t expectedPskc[] = {0x44, 0x98, 0x8e, 0x22, 0xcf, 0x65, 0x2e, 0xee,
|
||||
0xcc, 0xd1, 0xe4, 0xc0, 0x1d, 0x01, 0x54, 0xf8};
|
||||
0xcc, 0xd1, 0xe4, 0xc0, 0x1d, 0x01, 0x54, 0xf8};
|
||||
const otExtendedPanId xpanid = {{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}};
|
||||
const char passphrase[] = "123456";
|
||||
otInstance * instance = testInitInstance();
|
||||
otInstance *instance = testInitInstance();
|
||||
SuccessOrQuit(ot::MeshCoP::GeneratePskc(passphrase,
|
||||
*reinterpret_cast<const ot::MeshCoP::NetworkName *>("OpenThread"),
|
||||
static_cast<const ot::MeshCoP::ExtendedPanId &>(xpanid), pskc));
|
||||
@@ -54,24 +54,24 @@ void TestMaximumPassphrase(void)
|
||||
{
|
||||
ot::Pskc pskc;
|
||||
const uint8_t expectedPskc[] = {0x9e, 0x81, 0xbd, 0x35, 0xa2, 0x53, 0x76, 0x2f,
|
||||
0x80, 0xee, 0x04, 0xff, 0x2f, 0xa2, 0x85, 0xe9};
|
||||
0x80, 0xee, 0x04, 0xff, 0x2f, 0xa2, 0x85, 0xe9};
|
||||
const otExtendedPanId xpanid = {{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}};
|
||||
const char passphrase[] = "1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"123456781234567";
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"1234567812345678"
|
||||
"123456781234567";
|
||||
|
||||
otInstance *instance = testInitInstance();
|
||||
SuccessOrQuit(ot::MeshCoP::GeneratePskc(passphrase,
|
||||
@@ -85,7 +85,7 @@ void TestExampleInSpec(void)
|
||||
{
|
||||
ot::Pskc pskc;
|
||||
const uint8_t expectedPskc[] = {0xc3, 0xf5, 0x93, 0x68, 0x44, 0x5a, 0x1b, 0x61,
|
||||
0x06, 0xbe, 0x42, 0x0a, 0x70, 0x6d, 0x4c, 0xc9};
|
||||
0x06, 0xbe, 0x42, 0x0a, 0x70, 0x6d, 0x4c, 0xc9};
|
||||
const otExtendedPanId xpanid = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}};
|
||||
const char passphrase[] = "12SECRETPASSWORD34";
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ bool otPlatInfraIfHasAddress(uint32_t aInfraIfIndex, const otIp6Address *aAddres
|
||||
|
||||
otError otPlatInfraIfSendIcmp6Nd(uint32_t aInfraIfIndex,
|
||||
const otIp6Address *aDestAddress,
|
||||
const uint8_t * aBuffer,
|
||||
const uint8_t *aBuffer,
|
||||
uint16_t aBufferLength)
|
||||
{
|
||||
Icmp6Packet packet;
|
||||
@@ -656,9 +656,9 @@ struct DefaultRoute
|
||||
};
|
||||
|
||||
void SendRouterAdvert(const Ip6::Address &aRouterAddress,
|
||||
const Pio * aPios,
|
||||
const Pio *aPios,
|
||||
uint16_t aNumPios,
|
||||
const Rio * aRios,
|
||||
const Rio *aRios,
|
||||
uint16_t aNumRios,
|
||||
const DefaultRoute &aDefaultRoute)
|
||||
{
|
||||
@@ -720,7 +720,7 @@ void SendRouterAdvert(const Ip6::Address &aRouterAddress, const DefaultRoute &aD
|
||||
|
||||
struct OnLinkPrefix : public Pio
|
||||
{
|
||||
OnLinkPrefix(const Ip6::Prefix & aPrefix,
|
||||
OnLinkPrefix(const Ip6::Prefix &aPrefix,
|
||||
uint32_t aValidLifetime,
|
||||
uint32_t aPreferredLifetime,
|
||||
const Ip6::Address &aRouterAddress)
|
||||
@@ -734,7 +734,7 @@ struct OnLinkPrefix : public Pio
|
||||
|
||||
struct RoutePrefix : public Rio
|
||||
{
|
||||
RoutePrefix(const Ip6::Prefix & aPrefix,
|
||||
RoutePrefix(const Ip6::Prefix &aPrefix,
|
||||
uint32_t aValidLifetime,
|
||||
RoutePreference aPreference,
|
||||
const Ip6::Address &aRouterAddress)
|
||||
@@ -760,7 +760,7 @@ template <uint16_t kNumOnLinkPrefixes> void VerifyPrefixTable(const OnLinkPrefix
|
||||
|
||||
void VerifyPrefixTable(const OnLinkPrefix *aOnLinkPrefixes,
|
||||
uint16_t aNumOnLinkPrefixes,
|
||||
const RoutePrefix * aRoutePrefixes,
|
||||
const RoutePrefix *aRoutePrefixes,
|
||||
uint16_t aNumRoutePrefixes)
|
||||
{
|
||||
BorderRouter::RoutingManager::PrefixTableIterator iter;
|
||||
|
||||
@@ -60,7 +60,7 @@ static constexpr uint16_t kSkipRetainCountCheck = 0xffff;
|
||||
|
||||
template <typename PointerType>
|
||||
void VerifyPointer(const PointerType &aPointer,
|
||||
const TestObject * aObject,
|
||||
const TestObject *aObject,
|
||||
uint16_t aRetainCount = kSkipRetainCountCheck)
|
||||
{
|
||||
if (aObject == nullptr)
|
||||
|
||||
@@ -58,7 +58,7 @@ static const uint8_t sMysteryText[] = "4871(\\):|(3$}{4|/4/2%14(\\)";
|
||||
static const uint8_t sHexText[] = "0123456789abcdef";
|
||||
|
||||
static ot::Instance *sInstance;
|
||||
static MessagePool * sMessagePool;
|
||||
static MessagePool *sMessagePool;
|
||||
|
||||
struct CallbackContext
|
||||
{
|
||||
@@ -126,10 +126,10 @@ void VerifyAndRemoveTagFromHistory(Spinel::Buffer::FrameTag aTag, Spinel::Buffer
|
||||
}
|
||||
}
|
||||
|
||||
void FrameAddedCallback(void * aContext,
|
||||
void FrameAddedCallback(void *aContext,
|
||||
Spinel::Buffer::FrameTag aTag,
|
||||
Spinel::Buffer::Priority aPriority,
|
||||
Spinel::Buffer * aNcpBuffer)
|
||||
Spinel::Buffer *aNcpBuffer)
|
||||
{
|
||||
CallbackContext *callbackContext = reinterpret_cast<CallbackContext *>(aContext);
|
||||
|
||||
@@ -143,10 +143,10 @@ void FrameAddedCallback(void * aContext,
|
||||
callbackContext->mFrameAddedCount++;
|
||||
}
|
||||
|
||||
void FrameRemovedCallback(void * aContext,
|
||||
void FrameRemovedCallback(void *aContext,
|
||||
Spinel::Buffer::FrameTag aTag,
|
||||
Spinel::Buffer::Priority aPriority,
|
||||
Spinel::Buffer * aNcpBuffer)
|
||||
Spinel::Buffer *aNcpBuffer)
|
||||
{
|
||||
CallbackContext *callbackContext = reinterpret_cast<CallbackContext *>(aContext);
|
||||
|
||||
@@ -173,7 +173,7 @@ void ReadAndVerifyContent(Spinel::Buffer &aNcpBuffer, const uint8_t *aContentBuf
|
||||
|
||||
void WriteTestFrame1(Spinel::Buffer &aNcpBuffer, Spinel::Buffer::Priority aPriority)
|
||||
{
|
||||
Message * message;
|
||||
Message *message;
|
||||
CallbackContext oldContext;
|
||||
|
||||
message = sMessagePool->Allocate(Message::kTypeIp6);
|
||||
@@ -216,8 +216,8 @@ void VerifyAndRemoveFrame1(Spinel::Buffer &aNcpBuffer)
|
||||
|
||||
void WriteTestFrame2(Spinel::Buffer &aNcpBuffer, Spinel::Buffer::Priority aPriority)
|
||||
{
|
||||
Message * message1;
|
||||
Message * message2;
|
||||
Message *message1;
|
||||
Message *message2;
|
||||
CallbackContext oldContext = sContext;
|
||||
|
||||
message1 = sMessagePool->Allocate(Message::kTypeIp6);
|
||||
@@ -262,7 +262,7 @@ void VerifyAndRemoveFrame2(Spinel::Buffer &aNcpBuffer)
|
||||
|
||||
void WriteTestFrame3(Spinel::Buffer &aNcpBuffer, Spinel::Buffer::Priority aPriority)
|
||||
{
|
||||
Message * message1;
|
||||
Message *message1;
|
||||
CallbackContext oldContext = sContext;
|
||||
|
||||
message1 = sMessagePool->Allocate(Message::kTypeIp6);
|
||||
@@ -335,7 +335,7 @@ void TestBuffer(void)
|
||||
uint8_t buffer[kTestBufferSize];
|
||||
Spinel::Buffer ncpBuffer(buffer, kTestBufferSize);
|
||||
|
||||
Message * message;
|
||||
Message *message;
|
||||
uint8_t readBuffer[16];
|
||||
uint16_t readLen, readOffset;
|
||||
Spinel::Buffer::WritePosition pos1, pos2;
|
||||
|
||||
@@ -90,12 +90,12 @@ void TestDecoder(void)
|
||||
int64_t i64;
|
||||
unsigned int u_1, u_2, u_3, u_4;
|
||||
const spinel_ipv6addr_t *ip6Addr;
|
||||
const spinel_eui48_t * eui48;
|
||||
const spinel_eui64_t * eui64;
|
||||
const char * utf_1;
|
||||
const char * utf_2;
|
||||
const uint8_t * dataPtr_1;
|
||||
const uint8_t * dataPtr_2;
|
||||
const spinel_eui48_t *eui48;
|
||||
const spinel_eui64_t *eui64;
|
||||
const char *utf_1;
|
||||
const char *utf_2;
|
||||
const uint8_t *dataPtr_1;
|
||||
const uint8_t *dataPtr_2;
|
||||
uint16_t dataLen_1;
|
||||
uint16_t dataLen_2;
|
||||
|
||||
|
||||
@@ -105,11 +105,11 @@ void TestEncoder(void)
|
||||
int64_t i64;
|
||||
unsigned int u_1, u_2, u_3, u_4;
|
||||
spinel_ipv6addr_t *ip6Addr;
|
||||
spinel_eui48_t * eui48;
|
||||
spinel_eui64_t * eui64;
|
||||
const char * utf_1;
|
||||
const char * utf_2;
|
||||
const uint8_t * dataPtr;
|
||||
spinel_eui48_t *eui48;
|
||||
spinel_eui64_t *eui64;
|
||||
const char *utf_1;
|
||||
const char *utf_2;
|
||||
const uint8_t *dataPtr;
|
||||
spinel_size_t dataLen;
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
|
||||
@@ -230,9 +230,9 @@ static UpdateHandlerMode sUpdateHandlerMode = kAccept;
|
||||
static bool sProcessedUpdateCallback = false;
|
||||
|
||||
void HandleSrpServerUpdate(otSrpServerServiceUpdateId aId,
|
||||
const otSrpServerHost * aHost,
|
||||
const otSrpServerHost *aHost,
|
||||
uint32_t aTimeout,
|
||||
void * aContext)
|
||||
void *aContext)
|
||||
{
|
||||
Log("HandleSrpServerUpdate() called with %u, timeout:%u", aId, aTimeout);
|
||||
|
||||
@@ -259,9 +259,9 @@ static Error sLastClientCallbackError = kErrorNone;
|
||||
|
||||
void HandleSrpClientCallback(otError aError,
|
||||
const otSrpClientHostInfo *aHostInfo,
|
||||
const otSrpClientService * aServices,
|
||||
const otSrpClientService * aRemovedServices,
|
||||
void * aContext)
|
||||
const otSrpClientService *aServices,
|
||||
const otSrpClientService *aRemovedServices,
|
||||
void *aContext)
|
||||
{
|
||||
Log("HandleSrpClientCallback() called with error %s", ErrorToString(aError));
|
||||
|
||||
@@ -284,7 +284,7 @@ void PrepareService1(Srp::Client::Service &aService)
|
||||
static const char kSub1[] = "_sub1";
|
||||
static const char kSub2[] = "_V1234567";
|
||||
static const char kSub3[] = "_XYZWS";
|
||||
static const char * kSubLabels[] = {kSub1, kSub2, kSub3, nullptr};
|
||||
static const char *kSubLabels[] = {kSub1, kSub2, kSub3, nullptr};
|
||||
static const char kTxtKey1[] = "ABCD";
|
||||
static const uint8_t kTxtValue1[] = {'a', '0'};
|
||||
static const char kTxtKey2[] = "Z0";
|
||||
@@ -292,9 +292,9 @@ void PrepareService1(Srp::Client::Service &aService)
|
||||
static const char kTxtKey3[] = "D";
|
||||
static const uint8_t kTxtValue3[] = {0};
|
||||
static const otDnsTxtEntry kTxtEntries[] = {
|
||||
{kTxtKey1, kTxtValue1, sizeof(kTxtValue1)},
|
||||
{kTxtKey2, kTxtValue2, sizeof(kTxtValue2)},
|
||||
{kTxtKey3, kTxtValue3, sizeof(kTxtValue3)},
|
||||
{kTxtKey1, kTxtValue1, sizeof(kTxtValue1)},
|
||||
{kTxtKey2, kTxtValue2, sizeof(kTxtValue2)},
|
||||
{kTxtKey3, kTxtValue3, sizeof(kTxtValue3)},
|
||||
};
|
||||
|
||||
aService.mName = kServiceName;
|
||||
@@ -330,7 +330,7 @@ void ValidateHost(Srp::Server &aServer, const char *aHostName)
|
||||
// registered on SRP server.
|
||||
|
||||
const Srp::Server::Host *host;
|
||||
const char * name;
|
||||
const char *name;
|
||||
|
||||
Log("ValidateHost()");
|
||||
|
||||
@@ -351,8 +351,8 @@ void ValidateHost(Srp::Server &aServer, const char *aHostName)
|
||||
|
||||
void TestSrpServerBase(void)
|
||||
{
|
||||
Srp::Server * srpServer;
|
||||
Srp::Client * srpClient;
|
||||
Srp::Server *srpServer;
|
||||
Srp::Client *srpClient;
|
||||
Srp::Client::Service service1;
|
||||
Srp::Client::Service service2;
|
||||
uint16_t heapAllocations;
|
||||
@@ -476,8 +476,8 @@ void TestSrpServerBase(void)
|
||||
|
||||
void TestSrpServerReject(void)
|
||||
{
|
||||
Srp::Server * srpServer;
|
||||
Srp::Client * srpClient;
|
||||
Srp::Server *srpServer;
|
||||
Srp::Client *srpClient;
|
||||
Srp::Client::Service service1;
|
||||
Srp::Client::Service service2;
|
||||
uint16_t heapAllocations;
|
||||
@@ -588,8 +588,8 @@ void TestSrpServerReject(void)
|
||||
|
||||
void TestSrpServerIgnore(void)
|
||||
{
|
||||
Srp::Server * srpServer;
|
||||
Srp::Client * srpClient;
|
||||
Srp::Server *srpServer;
|
||||
Srp::Client *srpClient;
|
||||
Srp::Client::Service service1;
|
||||
Srp::Client::Service service2;
|
||||
uint16_t heapAllocations;
|
||||
|
||||
@@ -150,7 +150,7 @@ template <typename TimerType> int TestOneTimer(void)
|
||||
{
|
||||
const uint32_t kTimeT0 = 1000;
|
||||
const uint32_t kTimerInterval = 10;
|
||||
ot::Instance * instance = testInitInstance();
|
||||
ot::Instance *instance = testInitInstance();
|
||||
TestTimer<TimerType> timer(*instance);
|
||||
|
||||
// Test one Timer basic operation.
|
||||
@@ -276,7 +276,7 @@ template <typename TimerType> int TestTwoTimers(void)
|
||||
{
|
||||
const uint32_t kTimeT0 = 1000;
|
||||
const uint32_t kTimerInterval = 10;
|
||||
ot::Instance * instance = testInitInstance();
|
||||
ot::Instance *instance = testInitInstance();
|
||||
TestTimer<TimerType> timer1(*instance);
|
||||
TestTimer<TimerType> timer2(*instance);
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace ot {
|
||||
|
||||
void TestTlv(void)
|
||||
{
|
||||
Instance * instance = testInitInstance();
|
||||
Message * message;
|
||||
Instance *instance = testInitInstance();
|
||||
Message *message;
|
||||
Tlv tlv;
|
||||
ExtendedTlv extTlv;
|
||||
uint16_t offset;
|
||||
|
||||
Reference in New Issue
Block a user