Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for streambuffers with different notification index #1150

Merged

Conversation

glemco
Copy link
Contributor

@glemco glemco commented Dec 28, 2023

Description

This PR extends the unit tests for streambuffers to verify also the that the notification index matches, additionally it alters it to verify that we correctly handle different indices as introduced by FreeRTOS/FreeRTOS-Kernel#939

Test Steps

  • Go to FreeRTOS/Test/CMock/stream_buffer/
  • Run the tests with make
  • All the tests should pass

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

FreeRTOS/FreeRTOS-Kernel#939

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@glemco
Copy link
Contributor Author

glemco commented Dec 29, 2023

/bot run formatting

@glemco
Copy link
Contributor Author

glemco commented Jan 4, 2024

The problems with the spell check seem unrelated to the modified files, also I assume this PR shall be merged only after the functionality is merged and after updating the submodule revision. Is that correct?

@glemco
Copy link
Contributor Author

glemco commented Jan 26, 2024

It seems one automated test is failing because of higher memory use:

  2024-01-25 15:52:56,248 - INFO - Error:  StreamBuffer - tick count 5001 - free heap 23792 - min free heap 23680 - largest free block 23688 - number of free blocks 4
  2024-01-25 15:53:06,208 - INFO - Error:  StreamBuffer - tick count 10001 - free heap 16112 - min free heap 16000 - largest free block 16008 - number of free blocks 4
  2024-01-25 15:53:16,169 - INFO - Error:  StreamBuffer - tick count 15001 - free heap 8432 - min free heap 8320 - largest free block 8328 - number of free blocks 4
  2024-01-25 15:53:26,126 - INFO - Error:  StreamBuffer - tick count 20001 - free heap 752 - min free heap 640 - largest free block 648 - number of free blocks 4

Since the data structure slightly increased in size I'm assuming the problem is with that and requires increasing some limit in this MingW example. I'll look into that but I'm surprised the other demos (e.g. POSIX) don't fail in the same way.
I guess I need to find a windows machine where to debug this.

aggarg and others added 2 commits January 27, 2024 18:48
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
@@ -434,6 +474,7 @@ static void validate_stream_buffer_init_state( StreamBufferHandle_t xStreamBuffe
TEST_ASSERT_EQUAL( 0U, xStreamBufferBytesAvailable( xStreamBuffer ) );
TEST_ASSERT_EQUAL( 0U, xStreamBufferNextMessageLengthBytes( xStreamBuffer ) );
TEST_ASSERT_EQUAL( 0, ucStreamBufferGetStreamBufferType( xStreamBuffer ) );
TEST_ASSERT_EQUAL( tskDEFAULT_INDEX_TO_NOTIFY, uxStreamBufferGetStreamBufferNumber( xStreamBuffer ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it should be uxStreamBufferGetStreamBufferNotificationIndex.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very bad copy paste mistake, thanks for noticing!

@kar-rahul-aws kar-rahul-aws merged commit 770e93b into FreeRTOS:main Jan 29, 2024
24 checks passed
@glemco glemco deleted the streambuffer_notification_index_tests branch January 29, 2024 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants