Hi there!
I have read ur post and become aware that it is something I can fulfill.
while working on the project, i figured that u have used CMock + fff for testing.
If i would know more about the context of this project, i could provide better solutions.
Thanks for reading my proposal.
/************************************************************/
TEST_F(ATAppSystemTests, test_load_delay_before_repeat_success) {
const ATDelayBeforeRepeat m = ATDelayBeforeRepeatOff;
ATPALStoredDataReadResponse resp = {.result = ATPALStoredDataResultSuccess, .data = ATBytesCreate((const uint8_t *)&m, sizeof(m))};
StoredDataRetrieve_fake.return_val = resp;
bool fromStorage;
ATPairingMethod method = ATAppLoadDelayBeforeRepeat(&fromStorage);
ASSERT_EQ(method, ATDelayBeforeRepeatOff);
ASSERT_TRUE(fromStorage);
ASSERT_EQ(StoredDataRetrieve_fake.call_count, 1);
ASSERT_EQ(StoredDataRetrieve_fake.arg0_val, ATAppLoadDelayBeforeRepeat);
}
TEST_F(ATAppSystemTests, test_load_delay_before_repeat_fail_too_high) {
const uint8_t m = 2;
ATPALStoredDataReadResponse resp = {.result = ATPALStoredDataResultSuccess, .data = ATBytesCreate((const uint8_t *)&m, sizeof(m))};
StoredDataRetrieve_fake.return_val = resp;
ATDeviceDefaults defaults = {.delay_before_repeat = ATDelayBeforeRepeatOn};
ATDeviceCustomisation customisation = {.defaults = &defaults};