]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4483] Extra unit-tests added.
authorTomek Mrugalski <tomasz@isc.org>
Fri, 19 Aug 2016 17:49:20 +0000 (19:49 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 19 Aug 2016 17:49:20 +0000 (19:49 +0200)
src/lib/eval/tests/evaluate_unittest.cc

index 52c83fa16c05e538eb563b99b53c492465c0a6a0..befbfd6a17ff90bf4154ee8c18fc1f9e8cd60f26 100644 (file)
@@ -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);
+}
+
 };