mirror of https://github.com/deavmi/doap
CoapPacket (unit test)
- Added negative case for minimum packet size
This commit is contained in:
parent
1914f0741a
commit
4ec85231d5
|
@ -808,4 +808,26 @@ unittest
|
|||
|
||||
CoapPacket packet = CoapPacket.fromBytes(testingIn);
|
||||
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