]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add test for large ints
authorAlan T. DeKok <aland@freeradius.org>
Mon, 25 Mar 2024 14:20:50 +0000 (10:20 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 25 Mar 2024 14:20:50 +0000 (10:20 -0400)
src/tests/keywords/cast-integer

index 84459245cbe12d64f9c7fef28900fc6bd3a43c82..09ba3fd1fbcc2bef4875fe6aaa5033959d950f14 100644 (file)
@@ -1,3 +1,6 @@
+uint64 foo
+uint32 zscore
+
 #
 #  PRE: if
 #
@@ -14,3 +17,16 @@ if ((integer)&Class[0] < 256) {
 if ((integer)&Class[0] > 257) {
        test_fail
 }
+
+&zscore := 1
+
+&foo := (uint64) 0x10000000000001
+
+if (&foo != (&zscore + %cast('uint64', 0x10000000000000))) {
+       test_fail
+}
+
+if (&foo != (&zscore + (uint64) 0x10000000000000)) {
+       test_fail
+}
+