mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-13 23:46:51 +01:00
Fix MQTTSNPacket tests
This commit is contained in:
@@ -202,7 +202,7 @@ int MQTTSNDeserialize_pingresp(unsigned char* buf, int buflen)
|
|||||||
FUNC_ENTRY;
|
FUNC_ENTRY;
|
||||||
curdata += MQTTSNPacket_decode(curdata, buflen, &mylen); /* read length */
|
curdata += MQTTSNPacket_decode(curdata, buflen, &mylen); /* read length */
|
||||||
enddata = buf + mylen;
|
enddata = buf + mylen;
|
||||||
if (enddata - curdata < 2)
|
if (enddata - curdata < 1)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
if (readChar(&curdata) != MQTTSN_PINGRESP)
|
if (readChar(&curdata) != MQTTSN_PINGRESP)
|
||||||
@@ -475,5 +475,3 @@ exit:
|
|||||||
FUNC_EXIT_RC(rc);
|
FUNC_EXIT_RC(rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ int test1(struct Options options)
|
|||||||
assert("good rc from deserialize disconnect", rc == 1, "rc was %d\n", rc);
|
assert("good rc from deserialize disconnect", rc == 1, "rc was %d\n", rc);
|
||||||
|
|
||||||
/* data after should be the same as data before */
|
/* data after should be the same as data before */
|
||||||
assert("durations should be the same", 0 == duration_after, "durations were different\n", rc);
|
assert("durations should be the same", -1 == duration_after, "durations were different\n", rc);
|
||||||
|
|
||||||
/* Disconnect with duration */
|
/* Disconnect with duration */
|
||||||
rc = MQTTSNSerialize_disconnect(buf, buflen, 33);
|
rc = MQTTSNSerialize_disconnect(buf, buflen, 33);
|
||||||
|
|||||||
Reference in New Issue
Block a user