X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_tests_c_api.ml;h=0df9cd45331e2b8d73d0d695e3054f2eed136a7e;hp=5b4f7a80897c9adf187701c6dc0e449460598021;hb=0a7b734d2f54d4e98882532da9887feb66c9824a;hpb=5d93d70b4d36b2337104b3dbca07722fa4d47ff5 diff --git a/generator/generator_tests_c_api.ml b/generator/generator_tests_c_api.ml index 5b4f7a8..0df9cd4 100644 --- a/generator/generator_tests_c_api.ml +++ b/generator/generator_tests_c_api.ml @@ -257,8 +257,8 @@ int main (int argc, char *argv[]) exit (EXIT_FAILURE); } - if (guestfs_add_drive_ro (g, \"../../images/test.iso\") == -1) { - printf (\"guestfs_add_drive_ro ../../images/test.iso FAILED\\n\"); + if (guestfs_add_drive_ro (g, \"../data/test.iso\") == -1) { + printf (\"guestfs_add_drive_ro ../data/test.iso FAILED\\n\"); exit (EXIT_FAILURE); } @@ -818,29 +818,28 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd = fun (shift, bitmask) optarg -> let is_set = match optarg with - | Bool n, "" -> false - | Bool n, "true" -> + | OBool n, "" -> false + | OBool n, "true" -> pr " optargs.%s = 1;\n" n; true - | Bool n, "false" -> + | OBool n, "false" -> pr " optargs.%s = 0;\n" n; true - | Bool n, arg -> + | OBool n, arg -> failwithf "boolean optional arg '%s' should be empty string or \"true\" or \"false\"" n - | Int n, "" -> false - | Int n, i -> + | OInt n, "" -> false + | OInt n, i -> let i = try int_of_string i with Failure _ -> failwithf "integer optional arg '%s' should be empty string or number" n in pr " optargs.%s = %d;\n" n i; true - | Int64 n, "" -> false - | Int64 n, i -> + | OInt64 n, "" -> false + | OInt64 n, i -> let i = try Int64.of_string i with Failure _ -> failwithf "int64 optional arg '%s' should be empty string or number" n in pr " optargs.%s = %Ld;\n" n i; true - | String n, "NOARG" -> false - | String n, arg -> - pr " optargs.%s = \"%s\";\n" n (c_quote arg); true - | _ -> assert false in + | OString n, "NOARG" -> false + | OString n, arg -> + pr " optargs.%s = \"%s\";\n" n (c_quote arg); true in let bit = if is_set then Int64.shift_left 1L shift else 0L in let bitmask = Int64.logor bitmask bit in let shift = shift + 1 in