]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rearrange to have integer tests first
authorAlan T. DeKok <aland@freeradius.org>
Fri, 19 Nov 2021 14:30:12 +0000 (09:30 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 19 Nov 2021 14:30:12 +0000 (09:30 -0500)
src/tests/unit/calc.txt

index 926a0d91bce0ede83dff59e10cbf8386b46e1a8d..26209e2ec244a4ba914e469c8f811a964c79d33e 100644 (file)
@@ -2,6 +2,30 @@
 #  Calculate various thingies.
 #
 
+calc uint8 255 + uint8 255 -> uint8
+match Value overflows/underflows when calculating answer for uint8
+
+calc uint8 127 + uint8 127 -> uint8
+match 254
+
+#
+#  Wildly varying types get intermediate values upcast to the "best"
+#  type which is likely to handle the result.  The final result is
+#  then cast to the output type.
+#
+calc int8 -1 + uint8 14 -> int16
+match 13
+
+calc int32 -1 + uint8 14 -> int16
+match 13
+
+#
+#  Intermediate values are too large for destination, but the
+#  resulting value can fit.
+#
+calc uint32 1000 - uint32 999 -> uint8
+match 1
+
 # string append
 calc string "a" . string "b" -> string
 match ab
@@ -43,30 +67,6 @@ match yes
 calc string "stuff" < uint32 2 -> bool
 match Failed parsing string as type 'uint32'
 
-calc uint8 255 + uint8 255 -> uint8
-match Value overflows/underflows when calculating answer for uint8
-
-calc uint8 127 + uint8 127 -> uint8
-match 254
-
-#
-#  Wildly varying types get intermediate values upcast to the "best"
-#  type which is likely to handle the result.  The final result is
-#  then cast to the output type.
-#
-calc int8 -1 + uint8 14 -> int16
-match 13
-
-calc int32 -1 + uint8 14 -> int16
-match 13
-
-#
-#  Intermediate values are too large for destination, but the
-#  resulting value can fit.
-#
-calc uint32 1000 - uint32 999 -> uint8
-match 1
-
 #
 # make an IP out of a prefix and an offset
 #