Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Add CborDecoder LastError regression test
  • Loading branch information
sbaluja committed Sep 25, 2025
commit 5874a7238154c4d2477d0e7587b868d1551a9194
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)