Skip to content

Commit

Permalink
Merge pull request #257 from suvi-123/rectify_notification_failure
Browse files Browse the repository at this point in the history
Rectify notification test failure
  • Loading branch information
sadhyama authored Dec 14, 2023
2 parents 81198f4 + 294b5f9 commit edd7f95
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions tests/test_webpa_notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ void test_factory_reset_notification()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList1);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_components, getDeviceInfoCompDetails());
will_return(get_global_component_size, 1);
expect_function_call(CcspBaseIf_discComponentSupportingNamespace);
Expand All @@ -197,12 +203,6 @@ void test_factory_reset_notification()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList1);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList2);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
Expand Down Expand Up @@ -363,6 +363,12 @@ void test_FR_cloud_sync_notification()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_components, getDeviceInfoCompDetails());
will_return(get_global_component_size, 1);
expect_function_call(CcspBaseIf_discComponentSupportingNamespace);
Expand All @@ -375,12 +381,6 @@ void test_FR_cloud_sync_notification()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList2);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
Expand Down Expand Up @@ -454,6 +454,12 @@ void test_FR_cloud_sync_notification_retry()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, oldCmcList);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_components, getDeviceInfoCompDetails());
will_return(get_global_component_size, 1);
expect_function_call(CcspBaseIf_discComponentSupportingNamespace);
Expand All @@ -466,12 +472,6 @@ void test_FR_cloud_sync_notification_retry()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, oldCmcList);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(libparodus_send, (intptr_t)0);
expect_function_call(libparodus_send);

Expand Down Expand Up @@ -553,6 +553,12 @@ void test_FR_notify_cloud_status_retry()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_components, getDeviceInfoCompDetails());
will_return(get_global_component_size, 1);
expect_function_call(CcspBaseIf_discComponentSupportingNamespace);
Expand All @@ -565,12 +571,6 @@ void test_FR_notify_cloud_status_retry()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_values, cmcList2);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
Expand Down Expand Up @@ -670,18 +670,18 @@ void test_factory_reset_notification_with_cmc_512()
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_components, getDeviceInfoCompDetails());
will_return(get_global_component_size, 1);
expect_function_call(CcspBaseIf_discComponentSupportingNamespace);
will_return(CcspBaseIf_discComponentSupportingNamespace, CCSP_SUCCESS);
expect_function_call(free_componentStruct_t);

will_return(get_global_values, rebootReasonList);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
will_return(CcspBaseIf_getParameterValues, CCSP_SUCCESS);
expect_value(CcspBaseIf_getParameterValues, size, 1);

will_return(get_global_components, getDeviceInfoCompDetails());
will_return(get_global_component_size, 1);
expect_function_call(CcspBaseIf_discComponentSupportingNamespace);
will_return(CcspBaseIf_discComponentSupportingNamespace, CCSP_SUCCESS);
expect_function_call(free_componentStruct_t);

will_return(get_global_values, cmcList1);
will_return(get_global_parameters_count, 1);
expect_function_call(CcspBaseIf_getParameterValues);
Expand Down Expand Up @@ -746,17 +746,17 @@ int main(void)
{
const struct CMUnitTest tests[] = {
cmocka_unit_test(test_device_status_notification),
//cmocka_unit_test(test_factory_reset_notification),
//cmocka_unit_test(test_FR_cloud_sync_notification),
cmocka_unit_test(test_factory_reset_notification),
cmocka_unit_test(test_FR_cloud_sync_notification),
cmocka_unit_test(test_firmware_upgrade_notification),
cmocka_unit_test(err_loadCfgFile),
cmocka_unit_test(err_loadCfgFile),
cmocka_unit_test(test_transaction_status_notification),
//cmocka_unit_test(test_FR_cloud_sync_notification_retry),
//cmocka_unit_test(test_FR_notify_cloud_status_retry),
cmocka_unit_test(test_FR_cloud_sync_notification_retry),
cmocka_unit_test(test_FR_notify_cloud_status_retry),
cmocka_unit_test(test_FR_notify_cloud_status_empty_mac),
cmocka_unit_test(test_manageable_notification),
cmocka_unit_test(err_manageable_notification),
//cmocka_unit_test(test_factory_reset_notification_with_cmc_512),
cmocka_unit_test(test_factory_reset_notification_with_cmc_512),
cmocka_unit_test(test_processNotification),
};

Expand Down

0 comments on commit edd7f95

Please sign in to comment.