@@ -1137,27 +1137,29 @@ void Test_CF_CFDP_ProcessPollingDirectories(void)
1137
1137
pdcfg = & config -> chan [UT_CFDP_CHANNEL ].polldir [0 ];
1138
1138
poll = & c -> poll [0 ];
1139
1139
1140
- /* nominal call, w/engine disabled (noop) */
1140
+ /* nominal call, polldir disabled (noop) */
1141
1141
UtAssert_VOIDCALL (CF_CFDP_ProcessPollingDirectories (c ));
1142
1142
UtAssert_UINT32_EQ (CF_AppData .hk .channel_hk [UT_CFDP_CHANNEL ].poll_counter , 0 );
1143
1143
1144
- /* nominal call, w/engine enabled, polldir enabled but interval_sec == 0 */
1145
- CF_AppData . engine . enabled = 1 ;
1146
- pdcfg -> enabled = 1 ;
1144
+ /* nominal call, polldir enabled but interval_sec == 0 */
1145
+ /* Will tick because CF_Timer_Expired stub returns 0 by default (not expired) */
1146
+ pdcfg -> enabled = 1 ;
1147
1147
UtAssert_VOIDCALL (CF_CFDP_ProcessPollingDirectories (c ));
1148
- UtAssert_UINT32_EQ (CF_AppData .hk .channel_hk [UT_CFDP_CHANNEL ].poll_counter , 0 );
1148
+ UtAssert_BOOL_FALSE (poll -> timer_set );
1149
+ UtAssert_UINT32_EQ (CF_AppData .hk .channel_hk [UT_CFDP_CHANNEL ].poll_counter , 1 );
1150
+ UtAssert_STUB_COUNT (CF_Timer_Tick , 1 );
1149
1151
1150
1152
/* with interval_sec nonzero the timer should get set, but not tick */
1151
1153
pdcfg -> interval_sec = 1 ;
1152
1154
UtAssert_VOIDCALL (CF_CFDP_ProcessPollingDirectories (c ));
1153
1155
UtAssert_BOOL_TRUE (poll -> timer_set );
1154
- UtAssert_STUB_COUNT (CF_Timer_Tick , 0 );
1156
+ UtAssert_STUB_COUNT (CF_Timer_Tick , 1 );
1155
1157
UtAssert_UINT32_EQ (CF_AppData .hk .channel_hk [UT_CFDP_CHANNEL ].poll_counter , 1 );
1156
1158
1157
1159
/* call again should tick */
1158
1160
UtAssert_VOIDCALL (CF_CFDP_ProcessPollingDirectories (c ));
1159
1161
UtAssert_BOOL_TRUE (poll -> timer_set );
1160
- UtAssert_STUB_COUNT (CF_Timer_Tick , 1 );
1162
+ UtAssert_STUB_COUNT (CF_Timer_Tick , 2 );
1161
1163
1162
1164
/* call again timer should expire and start a playback */
1163
1165
UT_SetDeferredRetcode (UT_KEY (CF_Timer_Expired ), 1 , true);
0 commit comments