Skip to content

Commit

Permalink
Add side-by-side v3 and v5 test.
Browse files Browse the repository at this point in the history
  • Loading branch information
CIPop committed Aug 14, 2023
1 parent e70d4e3 commit 2e590a9
Show file tree
Hide file tree
Showing 3 changed files with 933 additions and 6 deletions.
7 changes: 2 additions & 5 deletions MQTTPacket/src/MQTTPacketCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ enum msgTypes
{
CONNECT = 1, CONNACK, PUBLISH, PUBACK, PUBREC, PUBREL,
PUBCOMP, SUBSCRIBE, SUBACK, UNSUBSCRIBE, UNSUBACK,
PINGREQ, PINGRESP, DISCONNECT
#if defined(MQTTV5)
, AUTH
#endif
PINGREQ, PINGRESP, DISCONNECT, AUTH
};

/**
Expand Down Expand Up @@ -118,7 +115,7 @@ typedef struct {
int rem_len;
int32_t len;
char state;
}MQTTTransport;
} MQTTTransport;

int MQTTPacket_readnb(unsigned char* buf, int32_t buflen, MQTTTransport *trp);

Expand Down
28 changes: 27 additions & 1 deletion MQTTPacket/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,30 @@ ADD_TEST(
SET_TESTS_PROPERTIES(
test3
PROPERTIES TIMEOUT 540
)
)

ADD_EXECUTABLE(
test35
test35.c
../samples/transport.c
)

# Disabling deprecation warnings:
# warning: ‘ftime’ is deprecated [-Wdeprecated-declarations]
target_compile_options(test35 PRIVATE -Wno-deprecated-declarations)

TARGET_LINK_LIBRARIES(
test35
paho-embed-mqtt3c
paho-embed-mqtt5c
)

ADD_TEST(
NAME test35
COMMAND "test35" "--connection" ${MQTT_TEST_BROKER}
)

SET_TESTS_PROPERTIES(
test35
PROPERTIES TIMEOUT 540
)
Loading

0 comments on commit 2e590a9

Please sign in to comment.