From: Tomek Mrugalski Date: Fri, 19 Aug 2016 17:49:20 +0000 (+0200) Subject: [4483] Extra unit-tests added. X-Git-Tag: trac4631_base~15^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=33110039ea7e650f7bcc535f7b5c3a0aa73c0a8e;p=thirdparty%2Fkea.git [4483] Extra unit-tests added. --- diff --git a/src/lib/eval/tests/evaluate_unittest.cc b/src/lib/eval/tests/evaluate_unittest.cc index 52c83fa16c..befbfd6a17 100644 --- a/src/lib/eval/tests/evaluate_unittest.cc +++ b/src/lib/eval/tests/evaluate_unittest.cc @@ -402,4 +402,18 @@ TEST_F(ExpressionsTest, expressionsPkt4Hlen) { testExpression(Option::V4, "pkt4.mac == 0x010203040506", true); } +TEST_F(ExpressionsTest, expressionsPkt4type) { + + // We can inspect the option content directly, but + // it requires knowledge of the option type and its format. + testExpression(Option::V4, "option[53].hex == 0x0", false); + testExpression(Option::V4, "option[53].hex == 0x1", true); + testExpression(Option::V4, "option[53].hex == 0x2", false); + + // It's easier to simply use the pkt4.msgtype + testExpression(Option::V4, "pkt4.msgtype == 0", false); + testExpression(Option::V4, "pkt4.msgtype == 1", true); + testExpression(Option::V4, "pkt4.msgtype == 2", false); +} + };