Skip to content

Fix uninitialized values in unit tests - #384

Merged
allanli4 merged 1 commit into
FreeRTOS:mainfrom
allanli4:test/correct-unit-test-setup
Aug 13, 2026
Merged

Fix uninitialized values in unit tests#384
allanli4 merged 1 commit into
FreeRTOS:mainfrom
allanli4:test/correct-unit-test-setup

Conversation

@allanli4

@allanli4 allanli4 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Description

Fix uninitialized values in unit tests

Test-only change, no functional change to the library.

Test Steps

  • Zero-initialize MQTTSubscribeInfo_t in test_MQTTV5_GetSubscribePacketSize, test_MQTT_SerializeSubscribe and test_MQTT_SerializeUnsubscribe.
  • encodeVariableLength_cb_1bytelength now writes the encoded byte.
  • Set sessionPresent in test_MQTT_Connect_resendPendingAcks7 case 8.

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

N/A

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

@allanli4
allanli4 force-pushed the test/correct-unit-test-setup branch from 0962825 to 6cb17bf Compare August 5, 2026 23:47
@allanli4 allanli4 changed the title Correct unit test setup that relied on uninitialized values Fix uninitialized values in unit tests Aug 5, 2026
@allanli4
allanli4 force-pushed the test/correct-unit-test-setup branch from 6cb17bf to f6a50aa Compare August 6, 2026 20:44
@allanli4
allanli4 force-pushed the test/correct-unit-test-setup branch from f6a50aa to 0c30b54 Compare August 13, 2026 20:53
@allanli4
allanli4 force-pushed the test/correct-unit-test-setup branch from 0c30b54 to 1b1948e Compare August 13, 2026 21:41
@allanli4
allanli4 merged commit 7a3af58 into FreeRTOS:main Aug 13, 2026
11 checks passed
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.

3 participants