summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-11-24 14:04:28 +0000
committerRichard Jones <rjones@redhat.com>2009-11-24 16:01:11 +0000
commitb017cd67bb56284d05fc168d2b3536bee55b9ebf (patch)
tree2d07b075c94796877fab912f05ad95a517ece8fa /src
parent6b2c7a23b6c2d81c9e1825e8eb88ab446f63bf94 (diff)
downloadlibguestfs-b017cd67bb56284d05fc168d2b3536bee55b9ebf.tar.gz
libguestfs-b017cd67bb56284d05fc168d2b3536bee55b9ebf.tar.xz
libguestfs-b017cd67bb56284d05fc168d2b3536bee55b9ebf.zip
generator: Passing "" to StringList tests should turn into empty list.
This is a bug in the generator which wasn't being tickled. If you had a test which expected a StringList or DeviceList parameter, and you passed "" to that test, then you'd (probably) expect to be testing an empty list, but in fact you got a single element list containing an empty string. This fixes it so you get an empty list.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/generator.ml b/src/generator.ml
index a7135a79..1206be22 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -6644,6 +6644,8 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
| Int64 _, _
| Bool _, _
| FileIn _, _ | FileOut _, _ -> ()
+ | StringList n, "" | DeviceList n, "" ->
+ pr " const char *const %s[1] = { NULL };\n" n
| StringList n, arg | DeviceList n, arg ->
let strs = string_split " " arg in
iteri (