Skip to content

Commit

Permalink
Remove _WITH_MSG from unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dcristoloveanu committed Oct 11, 2018
1 parent eccfda0 commit 3529d26
Show file tree
Hide file tree
Showing 73 changed files with 641 additions and 640 deletions.
2 changes: 1 addition & 1 deletion deps/uhttp
4 changes: 2 additions & 2 deletions iothub_client/tests/blob_ut/blob_ut.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ TEST_FUNCTION(Blob_UploadMultipleBlocksFromSasUri_64MB_unhappy_paths)
BLOB_RESULT result = Blob_UploadMultipleBlocksFromSasUri("https://h.h/something?a=b", FileUpload_GetData_Callback, &context, &httpResponse, testValidBufferHandle, NULL, NULL);

///assert
ASSERT_ARE_NOT_EQUAL_WITH_MSG(BLOB_RESULT, BLOB_OK, result, temp_str);
ASSERT_ARE_NOT_EQUAL(BLOB_RESULT, BLOB_OK, result, temp_str);
}
}

Expand Down Expand Up @@ -1402,7 +1402,7 @@ TEST_FUNCTION(Blob_UploadMultipleBlocksFromSasUri_64MB_with_certificate_unhappy_
BLOB_RESULT result = Blob_UploadMultipleBlocksFromSasUri("https://h.h/something?a=b", FileUpload_GetData_Callback, &context, &httpResponse, testValidBufferHandle, "a", NULL);

///assert
ASSERT_ARE_NOT_EQUAL_WITH_MSG(BLOB_RESULT, BLOB_OK, result, temp_str);
ASSERT_ARE_NOT_EQUAL(BLOB_RESULT, BLOB_OK, result, temp_str);
}
}

Expand Down

Large diffs are not rendered by default.

82 changes: 41 additions & 41 deletions iothub_client/tests/common_dt_e2e/iothubclient_common_dt_e2e.c

Large diffs are not rendered by default.

86 changes: 43 additions & 43 deletions iothub_client/tests/common_e2e/iothubclient_common_e2e.c

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ TEST_FUNCTION(Retrieve_Options_failure_checks)
OPTIONHANDLER_HANDLE result = retry_control_retrieve_options(handle);

sprintf(error_msg, "On failed call %zu", i);
ASSERT_IS_NULL_WITH_MSG(result, error_msg);
ASSERT_IS_NULL(result, error_msg);
}

// cleanup
Expand Down Expand Up @@ -703,7 +703,7 @@ TEST_FUNCTION(Set_Options_failure_checks)

// assert
sprintf(error_msg, "On failed call %zu", i);
ASSERT_ARE_NOT_EQUAL_WITH_MSG(int, 0, result, error_msg);
ASSERT_ARE_NOT_EQUAL(int, 0, result, error_msg);
}

// cleanup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BEGIN_TEST_SUITE(iothub_invalidcert_e2e)
static void send_confirm_callback(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void* user_ctx)
{
CONNECTION_STATUS_INFO* conn_status = (CONNECTION_STATUS_INFO*)user_ctx;
ASSERT_IS_NOT_NULL_WITH_MSG(conn_status, "connection status callback context is NULL");
ASSERT_IS_NOT_NULL(conn_status, "connection status callback context is NULL");

conn_status->status_set = true;
conn_status->current_confirmation = result;
Expand All @@ -58,7 +58,7 @@ static void send_confirm_callback(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void
static void connection_status_callback(IOTHUB_CLIENT_CONNECTION_STATUS status, IOTHUB_CLIENT_CONNECTION_STATUS_REASON reason, void* user_ctx)
{
CONNECTION_STATUS_INFO* conn_status = (CONNECTION_STATUS_INFO*)user_ctx;
ASSERT_IS_NOT_NULL_WITH_MSG(conn_status, "connection status callback context is NULL");
ASSERT_IS_NOT_NULL(conn_status, "connection status callback context is NULL");

conn_status->status_set = true;
conn_status->current_status = status;
Expand All @@ -71,10 +71,10 @@ static IOTHUB_DEVICE_CLIENT_LL_HANDLE create_client(IOTHUB_CLIENT_TRANSPORT_PROV

IOTHUB_DEVICE_CLIENT_LL_HANDLE iothub_handle;
iothub_handle = IoTHubDeviceClient_LL_CreateFromConnectionString(connection_string, protocol);
ASSERT_IS_NOT_NULL_WITH_MSG(iothub_handle, "Could not create IoTHubDeviceClient_LL_CreateFromConnectionString");
ASSERT_IS_NOT_NULL(iothub_handle, "Could not create IoTHubDeviceClient_LL_CreateFromConnectionString");

IOTHUB_CLIENT_RESULT result = IoTHubDeviceClient_LL_SetConnectionStatusCallback(iothub_handle, connection_status_callback, conn_status);
ASSERT_ARE_EQUAL_WITH_MSG(IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_OK, result, "Could not set connection Status Callback");
ASSERT_ARE_EQUAL(IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_OK, result, "Could not set connection Status Callback");

return iothub_handle;
}
Expand All @@ -91,8 +91,8 @@ static void wait_for_unauthorized_send(IOTHUB_DEVICE_CLIENT_LL_HANDLE dev_handle
(nowTime = time(NULL)),
(difftime(nowTime, beginOperation) < MAX_CONNECT_CALLBACK_WAIT_TIME) && (!conn_status->status_set) // time box
);
ASSERT_IS_TRUE_WITH_MSG(conn_status->status_set, "Status callback did not get executed");
ASSERT_ARE_EQUAL_WITH_MSG(IOTHUB_CLIENT_CONFIRMATION_RESULT, IOTHUB_CLIENT_CONFIRMATION_ERROR, conn_status->current_confirmation, "Sending message was successful and should not have been");
ASSERT_IS_TRUE(conn_status->status_set, "Status callback did not get executed");
ASSERT_ARE_EQUAL(IOTHUB_CLIENT_CONFIRMATION_RESULT, IOTHUB_CLIENT_CONFIRMATION_ERROR, conn_status->current_confirmation, "Sending message was successful and should not have been");
}

static void wait_for_unauthorized_connection(IOTHUB_DEVICE_CLIENT_LL_HANDLE dev_handle, CONNECTION_STATUS_INFO* conn_status)
Expand All @@ -111,8 +111,8 @@ static void wait_for_unauthorized_connection(IOTHUB_DEVICE_CLIENT_LL_HANDLE dev_
(nowTime = time(NULL)),
(difftime(nowTime, beginOperation) < MAX_CONNECT_CALLBACK_WAIT_TIME) && (!conn_status->status_set) // time box
);
ASSERT_IS_TRUE_WITH_MSG(conn_status->status_set, "Status callback did not get executed");
ASSERT_ARE_EQUAL_WITH_MSG(IOTHUB_CLIENT_CONNECTION_STATUS, IOTHUB_CLIENT_CONNECTION_UNAUTHENTICATED, conn_status->current_status, "Connection was successful and should not have been");
ASSERT_IS_TRUE(conn_status->status_set, "Status callback did not get executed");
ASSERT_ARE_EQUAL(IOTHUB_CLIENT_CONNECTION_STATUS, IOTHUB_CLIENT_CONNECTION_UNAUTHENTICATED, conn_status->current_status, "Connection was successful and should not have been");
}

static void run_invalidcert_test(IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol)
Expand Down Expand Up @@ -147,7 +147,7 @@ TEST_SUITE_INITIALIZE(TestClassInitialize)
{
TEST_INITIALIZE_MEMORY_DEBUG(g_dllByDll);
int result = IoTHub_Init();
ASSERT_ARE_EQUAL_WITH_MSG(int, 0, result, "Iothub init failed");
ASSERT_ARE_EQUAL(int, 0, result, "Iothub init failed");
}

TEST_SUITE_CLEANUP(TestClassCleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ TEST_FUNCTION(IoTHubClient_EdgeHandle_Create_FAIL)
IOTHUB_CLIENT_EDGE_HANDLE handle = IoTHubClient_EdgeHandle_Create(&config, TEST_AUTHORIZATION_HANDLE, TEST_MODULE_ID);

//assert
ASSERT_IS_NULL_WITH_MSG(handle, tmp_msg);
ASSERT_IS_NULL(handle, tmp_msg);
}

umock_c_negative_tests_deinit();
Expand Down Expand Up @@ -798,7 +798,7 @@ TEST_FUNCTION(IoTHubClient_Edge_DeviceMethodInvoke_FAIL)
IOTHUB_CLIENT_RESULT result = IoTHubClient_Edge_DeviceMethodInvoke(handle, TEST_DEVICE_ID2, TEST_METHOD_NAME, TEST_METHOD_PAYLOAD, TEST_TIMEOUT, &responseStatus, &responsePayload, &responsePayloadSize);

//assert
ASSERT_IS_TRUE_WITH_MSG(result == IOTHUB_CLIENT_ERROR, tmp_msg);
ASSERT_IS_TRUE(result == IOTHUB_CLIENT_ERROR, tmp_msg);
}

//cleanup
Expand Down Expand Up @@ -1041,7 +1041,7 @@ TEST_FUNCTION(IoTHubClient_Edge_ModuleMethodInvoke_FAIL)
IOTHUB_CLIENT_RESULT result = IoTHubClient_Edge_ModuleMethodInvoke(handle, TEST_DEVICE_ID2, TEST_MODULE_ID2, TEST_METHOD_NAME, TEST_METHOD_PAYLOAD, TEST_TIMEOUT, &responseStatus, &responsePayload, &responsePayloadSize);

//assert
ASSERT_IS_TRUE_WITH_MSG(result == IOTHUB_CLIENT_ERROR, tmp_msg);
ASSERT_IS_TRUE(result == IOTHUB_CLIENT_ERROR, tmp_msg);
}

//cleanup
Expand Down
Loading

0 comments on commit 3529d26

Please sign in to comment.