[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_1-9-gf1bb1ce

Rémi Cardona nobody at users.sourceforge.net
Wed Apr 27 23:37:49 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  f1bb1ce3556fd1799f881fdbc934cede209038de (commit)
      from  4e4ba6e80f43e4af143de18c03fca68bcd192933 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f1bb1ce3556fd1799f881fdbc934cede209038de
Author: Rémi Cardona <remi at gentoo.org>
Date:   Fri Apr 22 08:37:00 2011 +0200

    tests: fix gsb_real/gsb_data_account related tests
    
    All the literal integers now wrapped in the G_GINT64_CONSTANT were being
    compiled as another value as they overflow traditional 32bit integer
    limits.
    
    I'm not quite sure why this is failing now, but this is the correct way to
    specify 64bit literal integers as the LL prefix is a GNU extension.

-----------------------------------------------------------------------

Changes:
diff --git a/src/tests/gsb_data_account_cunit.c b/src/tests/gsb_data_account_cunit.c
index ea5dd18..c93e7b5 100644
--- a/src/tests/gsb_data_account_cunit.c
+++ b/src/tests/gsb_data_account_cunit.c
@@ -100,7 +100,7 @@ void gsb_data_account_cunit__gsb_data_account_calculate_current_and_marked_balan
     CU_ASSERT_EQUAL(0x80000000, balance.mantissa);
     CU_ASSERT_EQUAL(0, balance.exponent);
     */
-    CU_ASSERT_EQUAL(2200000021, balance.mantissa);
+    CU_ASSERT_EQUAL(G_GINT64_CONSTANT(2200000021), balance.mantissa);
     CU_ASSERT_EQUAL(2, balance.exponent);
     
     gint tr_number_3 = gsb_data_transaction_new_transaction(account_number);
diff --git a/src/tests/gsb_real_cunit.c b/src/tests/gsb_real_cunit.c
index e9fab2e..3f61668 100644
--- a/src/tests/gsb_real_cunit.c
+++ b/src/tests/gsb_real_cunit.c
@@ -246,17 +246,17 @@ void gsb_real_cunit__gsb_real_raw_get_from_string()
 
 /*     // too large positive number ==> error  */
     val = gsb_real_raw_get_from_string ( " 2 147 483 648 ", NULL, NULL );
-    CU_ASSERT_EQUAL ( 2147483648, val.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(2147483648), val.mantissa );
     CU_ASSERT_EQUAL ( 0, val.exponent );
 
 /*     // too large positive number ==> error  */
     val = gsb_real_raw_get_from_string ( " 2 147 483 649 ", NULL, NULL );
-    CU_ASSERT_EQUAL ( 2147483649, val.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(2147483649), val.mantissa );
     CU_ASSERT_EQUAL ( 0, val.exponent );
 
 /*     // very large positive number ==> error  */
     val = gsb_real_raw_get_from_string ( " 112 147 483 649 ", NULL, NULL );
-    CU_ASSERT_EQUAL ( 112147483649, val.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(112147483649), val.mantissa );
     CU_ASSERT_EQUAL ( 0, val.exponent );
 
 /*     // 0 with positive sign  */
@@ -329,19 +329,19 @@ void gsb_real_cunit__gsb_real_raw_get_from_string()
     CU_ASSERT_EQUAL ( -2147483647, val.mantissa );
     CU_ASSERT_EQUAL ( 0, val.exponent );
 
-/*     // too large negative number ==> error  */
+    /*  G_MININT - 1 */
     val = gsb_real_raw_get_from_string ( " -2 147 483 648 ", NULL, NULL );
-    CU_ASSERT_EQUAL ( -2147483648, val.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(-2147483648), val.mantissa );
     CU_ASSERT_EQUAL ( 0, val.exponent );
 
-/*     // too large negative number ==> error  */
+    /* G_MININT - 2 */
     val = gsb_real_raw_get_from_string ( " -2 147 483 649 ", NULL, NULL );
-    CU_ASSERT_EQUAL ( -2147483649, val.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(-2147483649), val.mantissa );
     CU_ASSERT_EQUAL ( 0, val.exponent );
 
-/*     // too large negative number ==> error  */
+    /* large negative number */
     val = gsb_real_raw_get_from_string ( " -112 147 483 649 ", NULL, NULL );
-    CU_ASSERT_EQUAL ( -112147483649, val.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(-112147483649), val.mantissa );
     CU_ASSERT_EQUAL ( 0, val.exponent );
 
 /*     // error number as string ==> error  */
@@ -424,19 +424,19 @@ void gsb_real_cunit__gsb_real_raw_format_string ( void )
     CU_ASSERT_STRING_EQUAL("<+>21< >474< >836<.>47<€>", s);
     g_free(s);
 
-    n.mantissa = -2147483649;
+    n.mantissa = G_GINT64_CONSTANT(-2147483649);
     n.exponent = 0;
     s = gsb_real_raw_format_string(n, &conv, currency_symbol);
     CU_ASSERT_STRING_EQUAL("<->2< >147< >483< >649<.>0<€>", s);
     g_free(s);
 
-    n.mantissa = -2147483649;
+    n.mantissa = G_GINT64_CONSTANT(-2147483649);
     n.exponent = 1;
     s = gsb_real_raw_format_string(n, &conv, currency_symbol);
     CU_ASSERT_STRING_EQUAL("<->214< >748< >364<.>9<€>", s);
     g_free(s);
 
-    n.mantissa = -2147483649;
+    n.mantissa = G_GINT64_CONSTANT(-2147483649);
     n.exponent = 2;
     s = gsb_real_raw_format_string(n, &conv, currency_symbol);
     CU_ASSERT_STRING_EQUAL("<->21< >474< >836<.>49<€>", s);
@@ -488,7 +488,7 @@ void gsb_real_cunit__gsb_real_get_string_with_currency ( void )
     CU_ASSERT_STRING_EQUAL(ERROR_REAL_STRING, s);
     g_free(s);
 
-    n.mantissa = 0x7fffffffffffffff + 1;
+    n.mantissa = G_GINT64_CONSTANT(0x8000000000000000);
     n.exponent = 2;
     s = gsb_real_get_string_with_currency ( n, currency_number, FALSE );
     CU_ASSERT_STRING_EQUAL(ERROR_REAL_STRING, s);
@@ -637,7 +637,7 @@ void gsb_real_cunit__gsb_real_mul()
     b.mantissa = 2;
     b.exponent = 0;
     r = gsb_real_mul ( a, b );
-    CU_ASSERT_EQUAL ( 4294967294, r.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(4294967294), r.mantissa );
     CU_ASSERT_EQUAL ( 0, r.exponent );
     
     a.mantissa = 0x7FFFFFFF;
@@ -669,7 +669,7 @@ void gsb_real_cunit__gsb_real_mul()
     b.mantissa = 100000;
     b.exponent = 0;
     r = gsb_real_mul ( a, b );
-    CU_ASSERT_EQUAL ( 2200000000, r.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(2200000000), r.mantissa );
     CU_ASSERT_EQUAL ( 0, r.exponent );
 
     a.mantissa = -22000;
@@ -677,7 +677,7 @@ void gsb_real_cunit__gsb_real_mul()
     b.mantissa = 100000;
     b.exponent = 0;
     r = gsb_real_mul ( a, b );
-    CU_ASSERT_EQUAL ( -2200000000, r.mantissa );
+    CU_ASSERT_EQUAL ( G_GINT64_CONSTANT(-2200000000), r.mantissa );
     CU_ASSERT_EQUAL ( 0, r.exponent );
 }
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list