mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 03:07:47 +00:00
[tests] ignore otError in spinel tests (#5093)
This commit is contained in:
@@ -222,7 +222,7 @@ jobs:
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
ncp:
|
||||
ncp-gcc-m32:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
CFLAGS: -m32
|
||||
@@ -250,3 +250,31 @@ jobs:
|
||||
VERBOSE=1 make -f examples/Makefile-simulation check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
ncp-clang:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
COVERAGE: 1
|
||||
NODE_TYPE: ncp-sim
|
||||
PYTHONUNBUFFERED: 1
|
||||
REFERENCE_DEVICE: 1
|
||||
VIRTUAL_TIME: 1
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y python3-setuptools
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
sudo python3 -m pip install git+https://github.com/openthread/pyspinel
|
||||
- name: Build
|
||||
run: |
|
||||
./bootstrap
|
||||
make -f examples/Makefile-simulation
|
||||
- name: Run
|
||||
run: |
|
||||
VERBOSE=1 make -f examples/Makefile-simulation check
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
|
||||
@@ -524,14 +524,14 @@ void TestBuffer(void)
|
||||
WriteTestFrame3(ncpBuffer, Spinel::Buffer::kPriorityHigh);
|
||||
|
||||
ncpBuffer.InFrameBegin((j % 2) == 0 ? Spinel::Buffer::kPriorityHigh : Spinel::Buffer::kPriorityLow);
|
||||
ncpBuffer.InFrameFeedData(sHelloText, sizeof(sHelloText));
|
||||
SuccessOrQuit(ncpBuffer.InFrameFeedData(sHelloText, sizeof(sHelloText)), "InFrameFeedData() failed.");
|
||||
|
||||
message = sMessagePool->New(Message::kTypeIp6, 0);
|
||||
VerifyOrQuit(message != NULL, "Null Message");
|
||||
SuccessOrQuit(message->SetLength(sizeof(sMysteryText)), "Could not set the length of message.");
|
||||
message->Write(0, sizeof(sMysteryText), sMysteryText);
|
||||
|
||||
ncpBuffer.InFrameFeedMessage(message);
|
||||
SuccessOrQuit(ncpBuffer.InFrameFeedMessage(message), "InFrameFeedMessage() failed.");
|
||||
|
||||
// Start writing a new frame in middle of an unfinished frame. Ensure the first one is discarded.
|
||||
WriteTestFrame1(ncpBuffer, frame1IsHighPriority ? Spinel::Buffer::kPriorityHigh : Spinel::Buffer::kPriorityLow);
|
||||
@@ -543,7 +543,7 @@ void TestBuffer(void)
|
||||
VerifyAndRemoveFrame3(ncpBuffer);
|
||||
|
||||
// Start reading few bytes from the frame
|
||||
ncpBuffer.OutFrameBegin();
|
||||
SuccessOrQuit(ncpBuffer.OutFrameBegin(), "OutFrameBegin() failed.");
|
||||
ncpBuffer.OutFrameReadByte();
|
||||
ncpBuffer.OutFrameReadByte();
|
||||
ncpBuffer.OutFrameReadByte();
|
||||
@@ -598,10 +598,10 @@ void TestBuffer(void)
|
||||
printf("\nTest 7: OutFrameRead() in parts\n");
|
||||
|
||||
ncpBuffer.InFrameBegin(Spinel::Buffer::kPriorityLow);
|
||||
ncpBuffer.InFrameFeedData(sMottoText, sizeof(sMottoText));
|
||||
ncpBuffer.InFrameEnd();
|
||||
SuccessOrQuit(ncpBuffer.InFrameFeedData(sMottoText, sizeof(sMottoText)), "InFrameFeedData() failed.");
|
||||
SuccessOrQuit(ncpBuffer.InFrameEnd(), "InFrameEnd() failed.");
|
||||
|
||||
ncpBuffer.OutFrameBegin();
|
||||
SuccessOrQuit(ncpBuffer.OutFrameBegin(), "OutFrameBegin() failed.");
|
||||
readOffset = 0;
|
||||
|
||||
while ((readLen = ncpBuffer.OutFrameRead(sizeof(readBuffer), readBuffer)) != 0)
|
||||
@@ -616,7 +616,7 @@ void TestBuffer(void)
|
||||
|
||||
VerifyOrQuit(readOffset == sizeof(sMottoText), "Read len does not match expected length.");
|
||||
|
||||
ncpBuffer.OutFrameRemove();
|
||||
SuccessOrQuit(ncpBuffer.OutFrameRemove(), "OutFrameRemove() failed.");
|
||||
|
||||
printf("\n -- PASS\n");
|
||||
|
||||
@@ -893,7 +893,8 @@ uint32_t GetRandom(uint32_t max)
|
||||
|
||||
if (kUseTrueRandomNumberGenerator)
|
||||
{
|
||||
Random::Crypto::FillBuffer(reinterpret_cast<uint8_t *>(&value), sizeof(value));
|
||||
SuccessOrQuit(Random::Crypto::FillBuffer(reinterpret_cast<uint8_t *>(&value), sizeof(value)),
|
||||
"Random::Crypto::FillBuffer() failed.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -621,13 +621,13 @@ void TestDecoder(void)
|
||||
// bytes in the frame.
|
||||
VerifyOrQuit(decoder.OpenStruct() == OT_ERROR_PARSE, "OpenStruct() did not fail.");
|
||||
|
||||
decoder.ResetToSaved();
|
||||
SuccessOrQuit(decoder.ResetToSaved(), "ResetToSaved() failed.");
|
||||
|
||||
SuccessOrQuit(decoder.ReadUint8(u8), "ReadUint8() failed.");
|
||||
VerifyOrQuit(u8 == kUint8, "ReadUint8() parse failed.");
|
||||
VerifyOrQuit(decoder.ReadDataWithLen(dataPtr_1, dataLen_1) == OT_ERROR_PARSE, "ReadDataWithLen() did not fail.");
|
||||
|
||||
decoder.ResetToSaved();
|
||||
SuccessOrQuit(decoder.ResetToSaved(), "ResetToSaved() failed.");
|
||||
SuccessOrQuit(decoder.ReadUint8(u8), "ReadUint8() failed.");
|
||||
SuccessOrQuit(decoder.ReadUint16(u16), "ReadUint16() failed.");
|
||||
SuccessOrQuit(decoder.ReadBool(b_1), "ReadUint16() failed.");
|
||||
|
||||
Reference in New Issue
Block a user