Skip to content

Commit

Permalink
Basic operation submission testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Bret Ambrose committed Mar 12, 2024
1 parent 6cc7723 commit c775de9
Show file tree
Hide file tree
Showing 3 changed files with 713 additions and 1 deletion.
10 changes: 10 additions & 0 deletions source/request-response/request_response_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ static struct aws_mqtt_request_response_client *s_aws_mqtt_request_response_clie
NULL,
NULL);

aws_linked_list_init(&rr_client->operation_queue);

aws_task_init(
&rr_client->external_shutdown_task,
s_mqtt_request_response_client_external_shutdown_task_fn,
Expand Down Expand Up @@ -840,6 +842,14 @@ static bool s_are_request_operation_options_valid(
AWS_BYTE_CURSOR_PRI(path->topic));
return false;
}

if (path->correlation_token_json_path.len == 0) {
AWS_LOGF_ERROR(
AWS_LS_MQTT_REQUEST_RESPONSE,
"(%p) rr client request options - empty correlation token json path",
(void *)client);
return false;
}
}

if (request_options->correlation_token.len == 0) {
Expand Down
11 changes: 11 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,17 @@ add_test_case(rrsm_subscription_lost_while_unsubscribing)
add_test_case(rrc_mqtt5_create_destroy)
add_test_case(rrc_mqtt311_create_destroy)

add_test_case(rrc_submit_request_operation_failure_no_response_paths)
add_test_case(rrc_submit_request_operation_failure_invalid_response_topic)
add_test_case(rrc_submit_request_operation_failure_invalid_response_correlation_token_path)
add_test_case(rrc_submit_request_operation_failure_no_correlation_token)
add_test_case(rrc_submit_request_operation_failure_invalid_publish_topic)
add_test_case(rrc_submit_request_operation_failure_empty_request)
add_test_case(rrc_submit_streaming_operation_failure_invalid_subscription_topic_filter)

add_test_case(rrc_submit_request_operation_failure_by_shutdown)
add_test_case(rrc_submit_streaming_operation_and_shutdown)

generate_test_driver(${PROJECT_NAME}-tests)

set(TEST_PAHO_CLIENT_BINARY_NAME ${PROJECT_NAME}-paho-client)
Expand Down
Loading

0 comments on commit c775de9

Please sign in to comment.