Displaying 20 results from an estimated 29 matches for "expect_error".
2016 Jan 27
2
[PATCH 1/2] generator: add TestRunOrUnsupported test type
...#include \"guestfs.h\"
#include \"guestfs-internal-frontend.h\"
@@ -335,6 +336,23 @@ and generate_test_perform name i test_name test =
let seq, last = get_seq_last seq in
List.iter (generate_test_command_call test_name) seq;
generate_test_command_call test_name ~expect_error:true last
+
+ | TestRunOrUnsupported seq ->
+ pr " /* TestRunOrUnsupported for %s (%d) */\n" name i;
+ let seq, last = get_seq_last seq in
+ List.iter (generate_test_command_call test_name) seq;
+ generate_test_command_call test_name ~expect_error:true ~do_return:false ~r...
2009 Aug 17
1
two more warning-avoidance patches
...@ static void print_error (guestfs_h *g, void *data, const char *msg)
}
/* FIXME: nearly identical code appears in fish.c */
-static void print_strings (char const *const *argv)
+static void print_strings (char *const *argv)
{
int argc;
@@ -5869,7 +5869,7 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
fun i str ->
pr " const char *%s_%d = \"%s\";\n" n i (c_quote str);
) strs;
- pr " const char *%s[] = {\n" n;
+ pr " const char *const %s[] = {\n" n;...
2011 Nov 09
6
[PATCH] Add tune2fs support to libguestfs.
At the moment OpenStack uses kpartx and nbd to resize filesystems and
inject files to guests. I sincerely hope they don't allow untrusted
users to upload guest images / AMIs :-(
To fix this I'm looking into adding libguestfs support as an optional
backend in OpenStack.
The only missing feature in libguestfs is the ability to call tune2fs
on a filesystem. This patch series adds tune2fs
2016 Dec 08
3
[PATCH 1/2] Remove most instances of OCaml warning 52.
...ld for '%s'\n")
prog n;
corrupt_file () in
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index 8b98927..4a70433 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -557,13 +557,13 @@ and generate_test_command_call ?(expect_error = false) ?(do_return = true) ?test
| Int _, arg, _ ->
let i =
try int_of_string arg
- with Failure "int_of_string" ->
+ with Failure _ ->
failwithf "%s: expecting an int, but got '%s'" test_name arg in
pr &quo...
2014 Feb 10
5
[PATCH 0/4] add GUID validation (RHBZ#1008417)
Hi,
this patch serie adds a new GUID type in the generator, which would do
the same as String, but also validating (just in the C output) the
passed GUID string.
This allows to reject invalid GUIDs before passing them to low-level
tools.
Pino Toscano (4):
utils: add a function to validate a GUID string
generator: add a GUID parameter type
generator: generate code for parameter validation
2014 Oct 22
0
[PATCH] tests: c-api: add $datadir and $databuilddir
...ot;; "/hivex_commit2_copy"; "false"]]), [["hivex_close"]]
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index 88aa07e..86bf08e 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -385,17 +385,16 @@ and generate_test_command_call ?(expect_error = false) ?test ?ret test_name cmd=
| String _, arg, sym
| OptString _, arg, sym
| Key _, arg, sym
- | GUID _, arg, sym ->
- pr " const char *%s = \"%s\";\n" sym (c_quote arg);
+ | GUID _, arg, sym
+ | FileIn _, arg, sym ->
+ pr " CL...
2015 Oct 20
3
[PATCH 1/2] generator: add a RelativePathnameList parameter type
...elativePathnameList n ->
pr " free (%s);\n" n
) args;
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index 1522eff..c5af42f 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -419,7 +419,8 @@ and generate_test_command_call ?(expect_error = false) ?test ?ret test_name cmd=
| DeviceList _, "", sym ->
pr " const char *const %s[1] = { NULL };\n" sym
| StringList _, arg, sym
- | DeviceList _, arg, sym ->
+ | DeviceList _, arg, sym
+ | RelativePathnameList _, arg, sym ->
let...
2015 Oct 21
2
[PATCH 1/2] generator: add a FilenameList parameter type
...st n | FilenameList n ->
pr " free (%s);\n" n
) args;
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index 1522eff..6be753f 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -419,7 +419,8 @@ and generate_test_command_call ?(expect_error = false) ?test ?ret test_name cmd=
| DeviceList _, "", sym ->
pr " const char *const %s[1] = { NULL };\n" sym
| StringList _, arg, sym
- | DeviceList _, arg, sym ->
+ | DeviceList _, arg, sym
+ | FilenameList _, arg, sym ->
let strs = s...
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but
don't update apis which must return mountables.
Matt
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky
for development (too easy to miss new ones) so I spent some
time last week and today working on removing them.
The first patch gets us down to almost no warnings with
the original -Wall setting. That was by far the hardest part.
Once I'd done that, I enabled nearly all of gcc's warnings via
gnulib's warnings and manywarnings modules
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...est_name name (String.uppercase test_name) (String.uppercase name);
+" test_name name
+ (String.uppercase_ascii test_name)
+ (String.uppercase_ascii name);
if not_disabled then (
generate_test_perform name i test_name test;
@@ -441,7 +444,7 @@ and generate_test_command_call ?(expect_error = false) ?(do_return = true) ?test
| StringList _, arg, sym
| DeviceList _, arg, sym
| FilenameList _, arg, sym ->
- let strs = string_split " " arg in
+ let strs = String.nsplit " " arg in
iteri (
fun i str ->
pr "...
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
..._
| BufferIn _ | Pointer _ -> ()
| StringList n | DeviceList n ->
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index e97e4ef..9cc047c 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -793,6 +793,7 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
| OptString n, "NULL" -> ()
| Pathname n, arg
| Device n, arg
+ | Mountable n, arg
| Dev_or_Path n, arg
| String n, arg
| OptString n, arg
@@ -902,7 +903,7 @@ and generate_test_command_call ?(ex...
2014 Oct 05
0
[PATCH v5 2/7] tests/c-api: Convert the C API tests to use the test harness.
...uot;;
+ ];
+ };
+
"inspector", {
defaults with
check = [
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index 88aa07e..86bf08e 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -385,17 +385,16 @@ and generate_test_command_call ?(expect_error = false) ?test ?ret test_name cmd=
| String _, arg, sym
| OptString _, arg, sym
| Key _, arg, sym
- | GUID _, arg, sym ->
- pr " const char *%s = \"%s\";\n" sym (c_quote arg);
+ | GUID _, arg, sym
+ | FileIn _, arg, sym ->
+ pr " CL...
2009 Aug 12
23
[PATCH 0/23] factor and const-correctness
This started as a simple warning-elimination change.
I'll get back to that series shortly ;-)
It turned into a factorization and constification exercise
during which I got a taste of ocaml. Thanks to Rich Jones
for help with a few snippets in generator.ml.
The overall result is that many previously-manually-maintained
bits from daemon/*.c functions are now hoisted into the automatically-
2015 Aug 06
0
[PATCH v4 02/17] tests/c-api: Convert the C API tests to use the test harness.
...uot;;
+ ];
+ };
+
"inspector", {
defaults with
check = [
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index 1522eff..5062ce1 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -403,17 +403,16 @@ and generate_test_command_call ?(expect_error = false) ?test ?ret test_name cmd=
| String _, arg, sym
| OptString _, arg, sym
| Key _, arg, sym
- | GUID _, arg, sym ->
- pr " const char *%s = \"%s\";\n" sym (c_quote arg);
+ | GUID _, arg, sym
+ | FileIn _, arg, sym ->
+ pr " CL...
2012 Jan 09
1
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally
useful to any binding which uses camel case by requirement or convention.
---
generator/generator_haskell.ml | 4 ++--
generator/generator_java.ml | 10 +++++-----
generator/generator_main.ml | 2 +-
generator/generator_structs.ml | 12 +++++-------
generator/generator_structs.mli | 8 ++++----
5
2016 Sep 02
6
[PATCH 0/4] generator: Some work to split large C files
By splitting up large C files we can make parallel compiles
a bit faster.
Rich.
2012 Aug 14
7
[PATCH 0/7] Add tar compress, numericowner, excludes flags.
https://bugzilla.redhat.com/show_bug.cgi?id=847880
https://bugzilla.redhat.com/show_bug.cgi?id=847881
This patch series adds various optional arguments to the tar-in and
tar-out commands.
Firstly (1/7) an optional "compress" flag is added to select
compression. This makes the calls tgz-in/tgz-out/txz-in/txz-out
deprecated, and expands the range of compression types available.
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...d1 field2;
+ pr " return -1;\n";
+ pr " }\n"
+ ) checks
in
List.iter (generate_test_command_call test_name) seq;
generate_test_command_call ~test test_name last
@@ -5576,84 +5576,84 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
| name :: args ->
(* Look up the command to find out what args/ret it has. *)
let style =
- try
- let _, style, _, _, _, _, _ =
- List.find (fun (n, _, _, _, _, _, _) -> n = name) all_functions in
- style
- with Not_found ->
- failw...
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...tringList (_, n) ->
pr " free (%s);\n" n
) args;
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index 7f89e0ed6..f9f14f6dc 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -411,15 +411,9 @@ and generate_test_command_call ?(expect_error = false) ?(do_return = true) ?test
List.iter (
function
| OptString _, "NULL", _ -> ()
- | Pathname _, arg, sym
- | Device _, arg, sym
- | Mountable _, arg, sym
- | Dev_or_Path _, arg, sym
- | Mountable_or_Path _, arg, sym
- | String _, arg, sym
- | Op...