]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
update json_conv tests to also test floats
authorPrashanth Mundkur <prashanth.mundkur@citrix.com>
Fri, 15 May 2009 17:11:44 +0000 (10:11 -0700)
committerPrashanth Mundkur <prashanth.mundkur@citrix.com>
Fri, 15 May 2009 17:21:42 +0000 (10:21 -0700)
gen/json_conv/tests/test_json_conv.ml
gen/json_conv/tests/test_types.ml

index 7cc9fdf3d7b9b429c2c7309a8f338fa0b849c3e5..33ba8b71a5261a240ab2d4a3d3506de82b7ddda7 100644 (file)
@@ -25,7 +25,8 @@ let check_base_type () =
        let bs = [ B_int 3;
                   B_int64 1L;
                   B_bool false;
-                  B_string "test"
+                  B_string "test";
+                  B_float 0.1
                 ] in
        test_list base_type_to_json base_type_of_json bs
 
@@ -35,6 +36,7 @@ let check_simple_type () =
                   S_int64_option (Some 0L);
                   S_bool_option (Some true);
                   S_string_option (Some "tset");
+                  S_float_option (Some 0.1);
 
                   S_int_list [ ];
                   S_int_list [ 3; 2; -1 ];
index 1252a249ca683e4e42aa46aafa5ae817b590ec0f..cc5f9b89711dc4879d14b4d6953b3f8e8742905e 100644 (file)
@@ -1,40 +1,42 @@
 
 type base_type =
-        | B_int of int
-        | B_int64 of int64
-        | B_bool of bool
-        | B_string of string
+       | B_int of int
+       | B_int64 of int64
+       | B_bool of bool
+       | B_string of string
+       | B_float of float
 
 type simple_type =
-        | S_int_option of int option
-        | S_int64_option of int64 option
-        | S_bool_option of bool option
-        | S_string_option of string option
-
-        | S_int_list of int list
-        | S_bool_list of bool list
-        | S_int64_list of int64 list
-        | S_string_list of string list
-
-        | S_int_array of int array
-        | S_bool_array of bool array
-        | S_int64_array of int64 array
-        | S_string_array of string array
+       | S_int_option of int option
+       | S_int64_option of int64 option
+       | S_bool_option of bool option
+       | S_string_option of string option
+       | S_float_option of float option
+
+       | S_int_list of int list
+       | S_bool_list of bool list
+       | S_int64_list of int64 list
+       | S_string_list of string list
+
+       | S_int_array of int array
+       | S_bool_array of bool array
+       | S_int64_array of int64 array
+       | S_string_array of string array
 
 (*** json-pragma:  set_record_prefix=record_  ***)
 
 type record_type =
 {
-        record_int: int;
-        record_int64: int64;
-        record_bool: bool;
-        record_string: string;
+       record_int: int;
+       record_int64: int64;
+       record_bool: bool;
+       record_string: string;
 
-        record_int_list: int list;
-        record_int64_option_array: (int64 option) array;
-        record_bool_array: bool array;
+       record_int_list: int list;
+       record_int64_option_array: (int64 option) array;
+       record_bool_array: bool array;
 
-        record_prod_list: ((int * bool) list) * string;
+       record_prod_list: ((int * bool) list) * string;
 }
 
 (*** json-pragma:  clear_record_prefix  ***)
@@ -43,6 +45,6 @@ type complex_type1 = ((int list) * bool) array
 
 type complex_type2 =
 {
-        record: record_type;
-        complex_type1: complex_type1;
+       record: record_type;
+       complex_type1: complex_type1;
 }