From: cedric Date: Thu, 17 May 2012 09:59:46 +0000 (+0000) Subject: eina: avoid wrong implicit conversion from unsigned to unsigned long in Eina_Value... X-Git-Tag: submit/2.0alpha-wayland/20121127.222009~136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02949658a59fcb8d5862b8e6ac9558e7c48b8526;p=profile%2Fivi%2Feina.git eina: avoid wrong implicit conversion from unsigned to unsigned long in Eina_Value tests There is no automatic promotion of unsigned to unsigned long when using va_arg, which means it is illegal to pass an 'unsigned' value and then use it as an unsigned long in eina_arg_vset. Doing so yields incorrect results on some architectures like itanium Patch by Albin 'Lutin' Tonnerre git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@71196 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/ChangeLog b/ChangeLog index 02b031f..d0b627e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -278,3 +278,5 @@ 2012-05-17 Albin Tonnerre * Fix portability issue of Eina_Value on ARM and PPC. + * Fix portability issue of Eina_Value test on Itanium. + diff --git a/NEWS b/NEWS index 04dff63..5e65a19 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ Fixes: * Rounding issue with eina_f32p32_cos and eina_f32p32_sin when getting close to 1.0. * Portability issue with Eina_Value when char are not signed by default (case on ARM and PPC). + * Portability issue with Eina_Value test suite when unsigned where not promoted to + unsigned long (case on Itanium). Eina 1.2.0 diff --git a/src/tests/eina_test_value.c b/src/tests/eina_test_value.c index d369208..68ef5ec 100644 --- a/src/tests/eina_test_value.c +++ b/src/tests/eina_test_value.c @@ -99,9 +99,9 @@ START_TEST(eina_value_test_simple) eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_ULONG)); - fail_unless(eina_value_set(value, 3000000001U)); + fail_unless(eina_value_set(value, 3000000001UL)); fail_unless(eina_value_get(value, &ul)); - fail_unless(ul == 3000000001U); + fail_unless(ul == 3000000001UL); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_UINT64)); @@ -540,10 +540,10 @@ START_TEST(eina_value_test_pvariant) eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_ULONG)); - in_ul = 3000000001U; + in_ul = 3000000001UL; fail_unless(eina_value_pset(value, &in_ul)); fail_unless(eina_value_pget(value, &ul)); - fail_unless(ul == 3000000001U); + fail_unless(ul == 3000000001UL); eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_UINT64)); @@ -713,10 +713,10 @@ START_TEST(eina_value_test_to_string) eina_value_flush(value); fail_unless(eina_value_setup(value, EINA_VALUE_TYPE_ULONG)); - in_ul = 3000000001U; + in_ul = 3000000001UL; fail_unless(eina_value_pset(value, &in_ul)); fail_unless(eina_value_pget(value, &ul)); - fail_unless(ul == 3000000001U); + fail_unless(ul == 3000000001UL); snprintf(buf, sizeof(buf), "%lu", in_ul); out = eina_value_to_string(value); fail_unless(out != NULL);