!fixup 052f529eb3d07170b18b8d0920bc8c450e389a2f
diff mbox series

Message ID 20180630165057.21632-1-f4bug@amsat.org
State New
Headers show
Series
  • !fixup 052f529eb3d07170b18b8d0920bc8c450e389a2f
Related show

Commit Message

Philippe Mathieu-Daudé June 30, 2018, 4:50 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
This was in e9dd993d-875f-4173-f68e-e6b4e75e3aa1@amsat.org but I can't
find it on the list...

 tests/test-cutils.c    | 2 +-
 tests/test-qemu-opts.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Paolo Bonzini July 2, 2018, 8:37 a.m. UTC | #1
On 30/06/2018 18:50, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> This was in e9dd993d-875f-4173-f68e-e6b4e75e3aa1@amsat.org but I can't
> find it on the list...
> 
>  tests/test-cutils.c    | 2 +-
>  tests/test-qemu-opts.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/test-cutils.c b/tests/test-cutils.c
> index a6e5fe4984..d85c3e0f6d 100644
> --- a/tests/test-cutils.c
> +++ b/tests/test-cutils.c
> @@ -26,7 +26,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -
> +#include "qemu/units.h"
>  #include "qemu/cutils.h"
>  #include "qemu/units.h"
>  
> diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
> index fd4d848f66..43869cb754 100644
> --- a/tests/test-qemu-opts.c
> +++ b/tests/test-qemu-opts.c
> @@ -8,7 +8,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "qemu/cutils.h"
> +#include "qemu/units.h"
>  #include "qemu/option.h"
>  #include "qemu/option_int.h"
>  #include "qapi/error.h"
> 

Squashed, thanks.

Paolo
Paolo Bonzini July 2, 2018, 1:32 p.m. UTC | #2
On 30/06/2018 18:50, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> This was in e9dd993d-875f-4173-f68e-e6b4e75e3aa1@amsat.org but I can't
> find it on the list...
> 
>  tests/test-cutils.c    | 2 +-
>  tests/test-qemu-opts.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/test-cutils.c b/tests/test-cutils.c
> index a6e5fe4984..d85c3e0f6d 100644
> --- a/tests/test-cutils.c
> +++ b/tests/test-cutils.c
> @@ -26,7 +26,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -
> +#include "qemu/units.h"
>  #include "qemu/cutils.h"
>  #include "qemu/units.h"
>  
> diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
> index fd4d848f66..43869cb754 100644
> --- a/tests/test-qemu-opts.c
> +++ b/tests/test-qemu-opts.c
> @@ -8,7 +8,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "qemu/cutils.h"
> +#include "qemu/units.h"
>  #include "qemu/option.h"
>  #include "qemu/option_int.h"
>  #include "qapi/error.h"
> 

Not enough, this is needed too in order to avoid integer overflows in constant expressions:

diff --git a/tests/test-keyval.c b/tests/test-keyval.c
index dce9f7a..09b0ae3 100644
--- a/tests/test-keyval.c
+++ b/tests/test-keyval.c
@@ -462,7 +462,7 @@ static void test_keyval_visit_size(void)
     visit_type_size(v, "sz4", &sz, &error_abort);
     g_assert_cmphex(sz, ==, GiB / 10);
     visit_type_size(v, "sz5", &sz, &error_abort);
-    g_assert_cmphex(sz, ==, 16777215 * TiB);
+    g_assert_cmphex(sz, ==, 16777215ULL * TiB);
     visit_check_struct(v, &error_abort);
     visit_end_struct(v, NULL);
     visit_free(v);
Stage this hunk [y,n,q,a,d,/,e,?]? y

diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index 43869cb..ef96e84 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -709,7 +709,7 @@ static void test_opts_parse_size(void)
                            false, &error_abort);
     g_assert_cmpuint(opts_count(opts), ==, 2);
     g_assert_cmphex(qemu_opt_get_size(opts, "size1", 0), ==, GiB / 10);
-    g_assert_cmphex(qemu_opt_get_size(opts, "size2", 0), ==, 16777215U * TiB);
+    g_assert_cmphex(qemu_opt_get_size(opts, "size2", 0), ==, 16777215ULL * TiB);
 
     /* Beyond limit with suffix */
     opts = qemu_opts_parse(&opts_list_02, "size1=16777216T",

Paolo

Patch
diff mbox series

diff --git a/tests/test-cutils.c b/tests/test-cutils.c
index a6e5fe4984..d85c3e0f6d 100644
--- a/tests/test-cutils.c
+++ b/tests/test-cutils.c
@@ -26,7 +26,7 @@ 
  */
 
 #include "qemu/osdep.h"
-
+#include "qemu/units.h"
 #include "qemu/cutils.h"
 #include "qemu/units.h"
 
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index fd4d848f66..43869cb754 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -8,7 +8,7 @@ 
  */
 
 #include "qemu/osdep.h"
-#include "qemu/cutils.h"
+#include "qemu/units.h"
 #include "qemu/option.h"
 #include "qemu/option_int.h"
 #include "qapi/error.h"