Commit 7dc676e5 authored by Ian Craggs's avatar Ian Craggs

Add another batch of MQTT V5 tests #470 #471 #487

parent d57c84b5
......@@ -1219,6 +1219,7 @@ static void MQTTAsync_writeComplete(int socket, int rc)
data.token = command->token;
data.code = rc;
data.message = NULL;
data.packet_type = PUBLISH;
Log(TRACE_MIN, -1, "Calling publish failure for client %s", m->c->clientID);
(*(command->onFailure5))(command->context, &data);
}
......@@ -3599,6 +3600,7 @@ static MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc)
data.token = command->command.token;
data.reasonCode = ack.rc;
data.properties = ack.properties;
data.packet_type = pack->header.bits.type;
Log(TRACE_MIN, -1, "Calling publish failure for client %s", m->c->clientID);
(*(command->command.onFailure5))(command->command.context, &data);
}
......
......@@ -455,6 +455,8 @@ typedef struct
int code;
/** Optional further text explaining the error. Can be NULL. */
const char *message;
/** Packet type on which the failure occurred - used for publish QoS 1/2 exchanges*/
int packet_type;
} MQTTAsync_failureData5;
#define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, SUCCESS, MQTTProperties_initializer, 0, NULL}
......
......@@ -98,8 +98,7 @@ int MQTTProperties_add(MQTTProperties* props, const MQTTProperty* prop)
if ((type = MQTTProperty_getType(prop->identifier)) < 0)
{
printf("id %d\n", prop->identifier);
StackTrace_printStack(stdout);
/*StackTrace_printStack(stdout);*/
rc = MQTT_INVALID_PROPERTY_ID;
goto exit;
}
......
......@@ -604,6 +604,21 @@ ADD_TEST(
COMMAND "test10" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY}
)
ADD_TEST(
NAME test10-7-request_response
COMMAND "test10" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY}
)
ADD_TEST(
NAME test10-8-subscribe_options
COMMAND "test10" "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY}
)
ADD_TEST(
NAME test10-9-shared_subscriptions
COMMAND "test10" "--test_no" "9" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY}
)
SET_TESTS_PROPERTIES(
test10-1-client_topic_aliases
test10-2-server_topic_aliases
......@@ -611,6 +626,9 @@ SET_TESTS_PROPERTIES(
test10-4-flow_control
test10-5-error_handling
test10-6-qos_1_2_errors
test10-7-request_response
test10-8-subscribe_options
test10-9-shared_subscriptions
PROPERTIES TIMEOUT 540
)
......
This diff is collapsed.
......@@ -1257,7 +1257,7 @@ void test_qos_1_2_errors_onPublishFailure3(void* context, MQTTAsync_failureData5
int rc;
MyLog(LOGA_INFO, "Callback: publish failure, reason code \"%s\" msgid: %d packet type: ",
MQTTReasonCodeString(response->reasonCode), response->token);
MQTTReasonCodeString(response->reasonCode), response->token, response->packet_type);
logProperties(&response->properties);
......@@ -1274,7 +1274,7 @@ void test_qos_1_2_errors_onPublishFailure2(void* context, MQTTAsync_failureData5
int rc;
MyLog(LOGA_INFO, "Callback: publish failure, reason code \"%s\" msgid: %d packet type: ",
MQTTReasonCodeString(response->reasonCode), response->token);
MQTTReasonCodeString(response->reasonCode), response->token, response->packet_type);
logProperties(&response->properties);
......@@ -1312,7 +1312,7 @@ void test_qos_1_2_errors_onPublishFailure(void* context, MQTTAsync_failureData5*
int rc;
MyLog(LOGA_INFO, "Callback: publish failure, reason code \"%s\" msgid: %d packet type: ",
MQTTReasonCodeString(response->reasonCode), response->token);
MQTTReasonCodeString(response->reasonCode), response->token, response->packet_type);
logProperties(&response->properties);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment