mirror of https://github.com/deavmi/doap
CoapPacket
- Made `OptionLenType` public CoapPacket (unittest) - Added unit tests for new static method added
This commit is contained in:
parent
2f68cc45eb
commit
f3522d780d
|
@ -719,6 +719,17 @@ version(unittest)
|
|||
import std.stdio;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests `CoapPacket`'s `determineLenType(size_t)'
|
||||
*/
|
||||
unittest
|
||||
{
|
||||
assert(CoapPacket.determineLenType(12) == CoapPacket.OptionLenType.ZERO_TO_TWELVE);
|
||||
assert(CoapPacket.determineLenType(268) == CoapPacket.OptionLenType._8BIT_EXTENDED);
|
||||
assert(CoapPacket.determineLenType(65804) == CoapPacket.OptionLenType._12_BIT_EXTENDED);
|
||||
assert(CoapPacket.determineLenType(65804+1) == CoapPacket.OptionLenType.UPPER_PAYLOAD_MARKER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoding tests
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue