mirror of
https://github.com/deavmi/doap
synced 2024-06-20 17:17:17 +02:00
CoapPacket (unit test)
- Added negative case for minimum packet size
This commit is contained in:
parent
1914f0741a
commit
4ec85231d5
|
@ -809,3 +809,25 @@ unittest
|
||||||
CoapPacket packet = CoapPacket.fromBytes(testingIn);
|
CoapPacket packet = CoapPacket.fromBytes(testingIn);
|
||||||
writeln(packet);
|
writeln(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the minimum size required for a packet
|
||||||
|
* (Negative case)
|
||||||
|
*/
|
||||||
|
unittest
|
||||||
|
{
|
||||||
|
ubyte[] testingIn = [];
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CoapPacket packet = CoapPacket.fromBytes(testingIn);
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
catch(CoapException e)
|
||||||
|
{
|
||||||
|
assert(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 0x41, 0x02, 0xcd, 0x47
|
Loading…
Reference in New Issue
Block a user