]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
switch with no match and no default
authorAlan T. DeKok <aland@freeradius.org>
Wed, 30 Nov 2016 13:30:38 +0000 (08:30 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 30 Nov 2016 13:30:38 +0000 (08:30 -0500)
src/tests/keywords/switch-nodefault [new file with mode: 0644]

diff --git a/src/tests/keywords/switch-nodefault b/src/tests/keywords/switch-nodefault
new file mode 100644 (file)
index 0000000..5fb9469
--- /dev/null
@@ -0,0 +1,22 @@
+#
+#  User-Name is "bob", and a switch statement
+#  with no "default" should not crash the server.
+#
+switch &User-Name {
+       case "doug" {
+               update reply {
+                       Filter-Id := "doug"
+               }
+       }
+}
+
+if (&reply:Filter-Id) {
+       update reply {
+               Filter-Id := "fail 1"
+       }
+}
+else {
+       update reply {
+               Filter-Id := "filter"
+       }
+}
\ No newline at end of file