]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more != to !(==)
authorAlan T. DeKok <aland@freeradius.org>
Mon, 5 Dec 2022 15:32:41 +0000 (10:32 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 5 Dec 2022 16:08:22 +0000 (11:08 -0500)
20 files changed:
src/tests/keywords/comments
src/tests/keywords/concat
src/tests/keywords/date
src/tests/keywords/edit-abort.ignore
src/tests/keywords/escape-sequences
src/tests/keywords/expr
src/tests/keywords/if-multiline
src/tests/keywords/load-balance
src/tests/keywords/module-failure-message
src/tests/keywords/pairs
src/tests/keywords/subrequest-src-dst
src/tests/keywords/subrequest-src-dst-nested
src/tests/keywords/update-unknown.ignore
src/tests/keywords/update-xlat.ignore
src/tests/keywords/xlat-escape
src/tests/keywords/xlat-explode
src/tests/keywords/xlat-integer
src/tests/keywords/xlat-soh
src/tests/keywords/xlat-string
src/tests/keywords/xlat-subst

index d0237265b5a57ac8503a7213688c7ed5022b1d9f..bfb568b40190b1f9bd50d8ff5c531a86c7a0b8d0 100644 (file)
@@ -29,7 +29,7 @@ if (!(&Tmp-String-0 == 'candy')) {
        test_fail
 }
 
-if (&request.Reply-Message[0] != 'I am #literally a comment #') {
+if !(&request.Reply-Message[0] == 'I am #literally a comment #') {
        test_fail
 }
 
index 7851f6c36b7a3f970363009c5e331f314473de34..5b38669cd25016f304d2435f6ab91b45441c9880 100644 (file)
@@ -52,7 +52,7 @@ if (!(&Tmp-String-4 == "ab c,de fg")) {
        &Tmp-String-5 = "%(concat:%{Tmp-String-0[*]} |-)"
 }
 
-if (&Tmp-String-5 !="ab c|-de fg") {
+if !(&Tmp-String-5 == "ab c|-de fg") {
        test_fail
 }
 
index 228593764b19ba7eb534d8185b4d0a09a3d22ba4..5422a9b2d1570899c6e90b8ca0b0e94012e43287 100644 (file)
@@ -41,7 +41,7 @@ if (!(&Tmp-Integer-2 == &Tmp-Integer-0)) {
 &Tmp-Date-0 := 1659985459
 &Tmp-String-2 := "%(sqldate:%{Tmp-Date-0})"
 
-if (&Tmp-String-2 != '2022-08-08 19:04:19') {
+if !(&Tmp-String-2 == '2022-08-08 19:04:19') {
        test_fail
 }
 
@@ -54,7 +54,7 @@ if (&Tmp-String-4) {
        test_fail
 }
 
-if (&Module-Failure-Message != "Failed to parse time string \"201-32-22 17:25:00\" as format '\%Y-\%m-\%d \%H:\%M:\%S'") {
+if (!(&Module-Failure-Message == "Failed to parse time string \"201-32-22 17:25:00\" as format '\%Y-\%m-\%d \%H:\%M:\%S'")) {
        test_fail
 }
 
index 8ef8a09b1c62420f46f68c209347c85c378de909..6b26b4452dac11fdae94865e8b6b3ab7579ddeb9 100644 (file)
@@ -16,11 +16,11 @@ update request {
 #
 #  The various edits above should have been reverted.
 #
-if (&Tmp-Integer-0 != 4) {
+if !(&Tmp-Integer-0 == 4) {
        test_fail
 }
 
-if (&Tmp-Integer-1 != 5) {
+if !(&Tmp-Integer-1 == 5) {
        test_fail
 }
 success
index 5a8003077b1c640bd3a222765f111794d133a32e..0ee571a01e69f240385afa604c638f9c2cbf8e96 100644 (file)
@@ -50,7 +50,7 @@ if (!("%{Tmp-String-0[1]}" == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
 }
 
 # And another slightly different codepath...
-if ("%{Tmp-String-0[*]}" != "i have scary embedded things\000 inside me0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°") {
+if !("%{Tmp-String-0[*]}" == "i have scary embedded things\000 inside me0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°") {
        test_fail
 }
 
index b57810c4b5736b19664ccd321f49b84ac944a4e1..4851a5581408b4f823e73ba67946d99e6c3ee3f1 100644 (file)
@@ -8,7 +8,7 @@
 if (!(%{expr: 1 + 2 + 3 + 4} == 10)) {
        test_fail
 }
-if (1 + 2 + 3 + 4 != 10) {
+if !(1 + 2 + 3 + 4 == 10) {
        test_fail
 }
 
@@ -18,7 +18,7 @@ if (1 + 2 + 3 + 4 != 10) {
 if (!(%{expr: 1 + 2 * 3 + 4} == 11)) {
        test_fail
 }
-if (1 + 2 * 3 + 4 != 11) {
+if !(1 + 2 * 3 + 4 == 11) {
        test_fail
 }
 
@@ -33,7 +33,7 @@ if (1 + 2 * 3 + 4 != 11) {
 if (!(%{expr: 1 + 2 * &Tmp-Integer-1 + 4} == 11)) {
        test_fail
 }
-if (1 + 2 * &Tmp-Integer-1 + 4 != 11) {
+if !(1 + 2 * &Tmp-Integer-1 + 4 == 11) {
        test_fail
 }
 
@@ -41,56 +41,56 @@ if (1 + 2 * &Tmp-Integer-1 + 4 != 11) {
 if (!(%{expr: 1 + 2 * (&Tmp-Integer-1 + 4)} == 15)) {
        test_fail
 }
-if (1 + 2 * (&Tmp-Integer-1 + 4) != 15) {
+if !(1 + 2 * (&Tmp-Integer-1 + 4) == 15) {
        test_fail
 }
 
 if (!(%{expr: 1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2)} == 15)) {
        test_fail
 }
-if (1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2) != 15) {
+if !(1 + 2 * (&Tmp-Integer-1 + &Tmp-Integer-2) == 15) {
        test_fail
 }
 
 if (!(%{expr: 1 & ~1} == 0)) {
        test_fail
 }
-if ((1 & ~1) != 0) {   # needs an extra () to resolve ambiguities and warnings
+if !((1 & ~1) == 0) {  # needs an extra () to resolve ambiguities and warnings
        test_fail
 }
 
 if (!(%{expr: 1 & ~2} == 1)) {
        test_fail
 }
-if ((1 & ~2) != 1) {   # needs an extra () to resolve ambiguities and warnings
+if !((1 & ~2) == 1) {  # needs an extra () to resolve ambiguities and warnings
        test_fail
 }
 
 if (!(%{expr: -1 * 2} == -2)) {
        test_fail
 }
-if (-1 * 2 != -2) {
+if !(-1 * 2 == -2) {
        test_fail
 }
 
 if (!(%{expr: 11 % 2} == 1)) {
        test_fail
 }
-if (11 % 2 != 1) {
+if !(11 % 2 == 1) {
        test_fail
 }
 
 if (!(%{expr: 2 - -1} == 3)) {
        test_fail
 }
-if (2 - -1 != 3) {
+if !(2 - -1 == 3) {
        test_fail
 }
 
 if (!(%{expr: 1 << 2 | 1} == 5)) {
        test_fail
 }
-if (((1 << 2) | 1) != 5) {     # needs extra () to resolve precedence
+if !(((1 << 2) | 1) == 5) {    # needs extra () to resolve precedence
        test_fail
 }
 
@@ -107,14 +107,14 @@ if (&Tmp-Date-0 <= 0) {
 if (!(%{expr: 6 + -(1 + 3)} == 2)) {
        test_fail
 }
-if (6 + -(1 + 3) != 2) {
+if !(6 + -(1 + 3) == 2) {
        test_fail
 }
 
 if (!(%{expr: 6 * -&Tmp-Integer-2} == -24)) {
        test_fail
 }
-if (6 * -&Tmp-Integer-2 != -24) {
+if !(6 * -&Tmp-Integer-2 == -24) {
        test_fail
 }
 
index d2f5573fdb36294ac52a3198f5d2acb45b7e1975..f57cacf0d5268eb835dca9c676afc2dfef1bd93d 100644 (file)
@@ -4,8 +4,8 @@
 #  Now that we ignore whitespace (including \r\n) inside of a *bracketed* expression,
 #  we can magically have multiline "if" statements.
 #
-if (1 + 2
-       != 3) {
+if !(1 + 2
+       == 3) {
        test_fail
 }
 success
index 863d06ebc0c8199c4a26bfd174d0c98200282926..8925bfd24490523ad467b1c5375141259f25b2a5 100644 (file)
@@ -90,7 +90,7 @@ if ((&Tmp-Integer-0 == 0) || (&Tmp-Integer-1 == 0)) {
        test_fail
 }
 
-if (&Tmp-Integer-0 + &Tmp-Integer-1 != 50) {
+if !(&Tmp-Integer-0 + &Tmp-Integer-1 == 50) {
        test_fail
 }
 
index 597adbd9d362be62d5182da7acfc18f74aff72fe..22088ce32497aac833a8d5f8081074c613a008c6 100644 (file)
@@ -4,23 +4,23 @@
 
 test
 
-if (&Module-Failure-Message[4] != 'test: RERROR error message') {
+if !(&Module-Failure-Message[4] == 'test: RERROR error message') {
        test_fail
 }
 
-if (&Module-Failure-Message[3] != 'test: RDEBUG error message') {
+if !(&Module-Failure-Message[3] == 'test: RDEBUG error message') {
        test_fail
 }
 
-if (&Module-Failure-Message[2] != 'test: RDEBUG2 error message') {
+if !(&Module-Failure-Message[2] == 'test: RDEBUG2 error message') {
        test_fail
 }
 
-if (&Module-Failure-Message[1] != 'test: RDEBUG3 error message') {
+if !(&Module-Failure-Message[1] == 'test: RDEBUG3 error message') {
        test_fail
 }
 
-if (&Module-Failure-Message[0] != 'test: RDEBUG4 error message') {
+if !(&Module-Failure-Message[0] == 'test: RDEBUG4 error message') {
        test_fail
 }
 
index 479ab5ed4a5dd22fbe0dbe99c8a79fb64bd9c84d..35b89f91992d91e50c85475d66eb4c40e7e1aee2 100644 (file)
        &Tmp-String-5 = "%(pairs:control.User-Name)"
 }
 
-if (&Tmp-String-1 != "User-Name = \"bob\", User-Password = \"hello\", Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331") {
+if !(&Tmp-String-1 == "User-Name = \"bob\", User-Password = \"hello\", Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331") {
        test_fail
 }
 
-if (&Tmp-String-2 != "Tmp-String-0 = \"This is a string\"") {
+if !(&Tmp-String-2 == "Tmp-String-0 = \"This is a string\"") {
        test_fail
 }
 
-if (&Tmp-String-3 != "Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\"") {
+if !(&Tmp-String-3 == "Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\"") {
        test_fail
 }
 
-if (&Tmp-String-4 != "Password.Cleartext = \"hello\"") {
+if !(&Tmp-String-4 == "Password.Cleartext = \"hello\"") {
        test_fail
 }
 
index e7d97a60dba88ee2360e4aec50a68b81331cd5b5..33162169e9c340bc74d12228397b270b21606ef7 100644 (file)
@@ -21,7 +21,7 @@ if (!&reply.Tmp-Group-0.Tmp-String-0) {
        test_fail
 }
 
-if (&reply.Tmp-Group-0.Tmp-String-0 != 'hello from subrequest') {
+if !(&reply.Tmp-Group-0.Tmp-String-0 == 'hello from subrequest') {
        test_fail
 }
 
index b45a7cdfc49d64a065af6343d65f5c7ff1968719..29121b9b95c0c0b7b050f83041d259738c86278f 100644 (file)
@@ -23,7 +23,7 @@ if (!&reply.Tmp-Group-0.Tmp-Group-0.Tmp-String-0) {
        test_fail
 }
 
-if (&reply.Tmp-Group-0.Tmp-Group-0.Tmp-String-0 != 'hello from subrequest') {
+if !(&reply.Tmp-Group-0.Tmp-Group-0.Tmp-String-0 == 'hello from subrequest') {
        test_fail
 }
 
index ad6cf32944778d1965fa6325c321bb11d3feee78..91f0589312ffc8ba60fa45ea1224947eca2f90aa 100644 (file)
@@ -15,15 +15,15 @@ update {
        &255 = 0x00
 }
 
-if (&26.6139.1 != 0x00000013) {
+if !(&26.6139.1 == 0x00000013) {
        test_fail
 }
 
-if (&26.9.42 != 0x0001020304) {
+if !(&26.9.42 == 0x0001020304) {
        test_fail
 }
 
-if (&255 != 0x00) {
+if !(&255 == 0x00) {
        test_fail
 }
 
index 01fcc231ad5d421bed290ac46f2d5f0c5b1e21b0..8b246a08f0ca82d2b500116bd41a3e53c66b05ef 100644 (file)
@@ -17,7 +17,7 @@ update request {
        "%{Tmp-String-0}" := 'hello'
 }
 
-if (&Tmp-String-1 != 'hello') {
+if !(&Tmp-String-1 == 'hello') {
        test_fail
 }
 
@@ -36,7 +36,7 @@ update {
        "Vendor-%{Tmp-Integer-0}-1" := 0x01020304
 }
 
-if (&Vendor-66-1 != 0x01020304) {
+if !(&Vendor-66-1 == 0x01020304) {
        test_fail
 }
 
@@ -51,7 +51,7 @@ update {
        "Vendor-%{Tmp-Integer-0}-1" := 127.0.0.1
 }
 
-if (&Vendor-Specific.FreeRADIUS.Proxied-To != 127.0.0.1) {
+if !(&Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.1) {
        test_fail
 }
 
@@ -59,7 +59,7 @@ update {
        "%(attr_num:Tmp-String-1)" := 'hello2'
 }
 
-if (&Tmp-String-1 != 'hello2') {
+if !(&Tmp-String-1 == 'hello2') {
        test_fail
 }
 
index 01b10009d6f2377fc62caf08839d46c735c4739b..8a5118104169763f28a455a1ec6c7347ff44458c 100644 (file)
@@ -4,11 +4,11 @@
 #
 #  Verify escaping of %
 #
-if ("\%{ FOO}" != '%{ FOO}') {
+if !("\%{ FOO}" == '%{ FOO}') {
        test_fail
 }
 
-if ("%{tolower:\%{ FOO}" != '%{ foo') {
+if !("%{tolower:\%{ FOO}" == '%{ foo') {
        test_fail
 }
 
index 5c432150ec6fd886e9faf9d860f1b28d2543901a..9def851422c8d6d9982b162780d47d4801211e25 100644 (file)
 
 debug_all
 
-if (!("%{Tmp-String-1}" == "1=1,my_attr=2,my_attr=hello")) {
+if (!(&Tmp-String-1 == "1=1,my_attr=2,my_attr=hello")) {
        test_fail
 }
 
-if (!("%{Tmp-String-2}" == "")) {
+if (!(&Tmp-String-2 == "")) {
        test_fail
 }
 
-if (!("%{Tmp-String-3}" == "hello,goodbye,morning,night,1")) {
+if (!(&Tmp-String-3 == "hello,goodbye,morning,night,1")) {
        test_fail
 }
 
-if ("%{Tmp-String-4}" != 'Can\'t touch this') {
+if !(&Tmp-String-4 == 'Can\'t touch this') {
        test_fail
 }
 
-if ("%{Tmp-String-5}" != 'here, are ,some, words') {
+if !(&Tmp-String-5 == 'here, are ,some, words') {
        test_fail
 }
 
index 137af3593276ba6431611300465846d47e373e5a..9d445a20789d400e49f7144586034b7fc3498741 100644 (file)
@@ -26,7 +26,7 @@ if (!(((integer)&Tmp-String-0 == &Tmp-Integer-1)) || (!(&Tmp-Integer-1 == 9870))
 
 # String - network order representation of a 8 char string
 &Tmp-uint64-0 := "%(integer:%{Tmp-String-1})"
-if (((integer64) &Tmp-String-1 != &Tmp-uint64-0) || (!(&Tmp-uint64-0 == 98709870))) {
+if (!((integer64) &Tmp-String-1 == &Tmp-uint64-0) || (!(&Tmp-uint64-0 == 98709870))) {
        test_fail
 }
 
index d8409350297a4a9ec39b479be5b2d5b4527a3c07..7e65fb5ddfe1562d70e01e3e3b245d394fbd0172 100644 (file)
@@ -39,7 +39,7 @@ if (!("%{Tmp-String-0}" == "Windows unknown")) {
 &Tmp-String-0 := %(soh:OS)
 
 # Complete set of data should match a real version of Windows
-if ("%{Tmp-String-0}" != "Windows Vista / Server 2008 6.0.6001 sp 1.0" ) {
+if !(&Tmp-String-0 == "Windows Vista / Server 2008 6.0.6001 sp 1.0" ) {
        test_fail
 }
 
index 045d36145c3d65246ad2f1185f4a447b94cbf754..b8116bc1a2409468dc8f590ceabb9601f2146e5c 100644 (file)
@@ -59,7 +59,7 @@ if (!("%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}test3" == "test1test2te
        test_fail
 }
 
-if (&Tmp-String-1 != 'I like chicken I like liver') {
+if !(&Tmp-String-1 == 'I like chicken I like liver') {
        test_fail
 }
 
index bb30c67d165110b07f0a95a5abd244826e650f33..35a195caa93bceaaec6c81a41bc5d942ceb3622e 100644 (file)
@@ -105,7 +105,7 @@ if ("%(subst:%{Tmp-String-0} /***/g .)") {
        test_fail
 }
 
-if (&Module-Failure-Message[0] != 'Failed compiling regex: quantifier does not follow a repeatable item') {
+if !(&Module-Failure-Message[0] == 'Failed compiling regex: quantifier does not follow a repeatable item') {
        test_fail
 }
 
@@ -116,7 +116,7 @@ if ("%(subst:%{Tmp-String-0} //g .)") {
        test_fail
 }
 
-if (&Module-Failure-Message[0] != 'Failed compiling regex: Empty expression') {
+if !(&Module-Failure-Message[0] == 'Failed compiling regex: Empty expression') {
        test_fail
 }
 }