Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/cbor/Cbor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ namespace Aws
*
*****************************************************/
CborDecoder::CborDecoder(ByteCursor src, Crt::Allocator *allocator) noexcept
: m_lastError(AWS_ERROR_SUCCESS)
{
m_decoder = aws_cbor_decoder_new(allocator, src);
}
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ endif()

add_test_case(CborSanityTest)
add_test_case(CborTimeStampTest)
add_test_case(CborLastErrorTest)

generate_cpp_test_driver(${TEST_BINARY_NAME})

Expand Down
17 changes: 17 additions & 0 deletions tests/CborTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,20 @@ static int s_CborTimeStampTest(struct aws_allocator *allocator, void *ctx)
}

AWS_TEST_CASE(CborTimeStampTest, s_CborTimeStampTest)

static int s_CborLastErrorTest(struct aws_allocator *allocator, void *ctx)
{
/**
* Test the last error is initialzed correctly.
*/
(void)ctx;
{
ApiHandle apiHandle(allocator);
Cbor::CborDecoder decoder({});
ASSERT_INT_EQUALS(decoder.LastError(), AWS_ERROR_UNKNOWN);
}

return AWS_OP_SUCCESS;
}

AWS_TEST_CASE(CborLastErrorTest, s_CborLastErrorTest)