[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_4-49-gdf486c2

Pierre Biava nobody at users.sourceforge.net
Sun Oct 24 08:51:24 CEST 2010


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  df486c2fa52c35628874682e4ad909eebf0c662e (commit)
      from  a19b5c801f066214f2c7db98694bebb8180e4db5 (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 df486c2fa52c35628874682e4ad909eebf0c662e
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Oct 24 08:40:34 2010 +0200

    Adding tests for gsb_real_format_string ()

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

Changes:
diff --git a/src/tests/gsb_real_cunit.c b/src/tests/gsb_real_cunit.c
index c564aa5..2f5f7ba 100644
--- a/src/tests/gsb_real_cunit.c
+++ b/src/tests/gsb_real_cunit.c
@@ -41,6 +41,7 @@ static void gsb_real_cunit__gsb_real_add ( void );
 static void gsb_real_cunit__gsb_real_get_from_string ( void );
 static void gsb_real_cunit__gsb_real_mul();
 static void gsb_real_cunit__gsb_real_normalize();
+static void gsb_real_cunit__gsb_real_format_string ( void );
 static void gsb_real_cunit__gsb_real_raw_format_string ( void );
 static void gsb_real_cunit__gsb_real_raw_get_from_string();
 static void gsb_real_cunit__gsb_real_raw_get_from_string__locale();
@@ -400,22 +401,6 @@ void gsb_real_cunit__gsb_real_raw_format_string ( void )
     CU_ASSERT_STRING_EQUAL("<+>0<.>000031415<€>", s);
     g_free(s);
 
-    /* TODO do this test for gsb_real_format_string instead
-    n.mantissa = 31415;
-    n.exponent = 10;
-    s = gsb_real_raw_format_string(n, &conv, currency_symbol);
-    CU_ASSERT_STRING_EQUAL("###ERR###", s);
-    g_free(s);
-    */
-
-    /* TODO do this test for gsb_real_format_string instead
-    n.mantissa = 31415;
-    n.exponent = -1;
-    s = gsb_real_raw_format_string(n, &conv, currency_symbol);
-    CU_ASSERT_STRING_EQUAL("###ERR###", s);
-    g_free(s);
-    */
-
     n.mantissa = 0x7FFFFFFF;
     n.exponent = 0;
     s = gsb_real_raw_format_string(n, &conv, currency_symbol);
@@ -452,14 +437,6 @@ void gsb_real_cunit__gsb_real_raw_format_string ( void )
     CU_ASSERT_STRING_EQUAL("<->21< >474< >836<.>49<€>", s);
     g_free(s);
 
-    /* TODO do this test for gsb_real_format_string instead
-    n.mantissa = 0x80000000;
-    n.exponent = 2;
-    s = gsb_real_raw_format_string(n, &conv, currency_symbol);
-    CU_ASSERT_STRING_EQUAL("###ERR###", s);
-    g_free(s);
-    */
-
     n.mantissa = 2100000000;
     n.exponent = 2;
     s = gsb_real_raw_format_string(n, &conv, currency_symbol);
@@ -481,6 +458,38 @@ void gsb_real_cunit__gsb_real_raw_format_string ( void )
     g_free(s);
 }
 
+
+void gsb_real_cunit__gsb_real_format_string ( void )
+{
+    gchar *s;
+    gsb_real n;
+    gint currency_number = 1;
+
+    n.mantissa = 0;
+    n.exponent = 0;
+    s = gsb_real_format_string ( n, currency_number, FALSE );
+    CU_ASSERT_STRING_EQUAL("0", s);
+    g_free(s);
+
+    n.mantissa = 31415;
+    n.exponent = 100;
+    s = gsb_real_format_string ( n, currency_number, FALSE );
+    CU_ASSERT_STRING_EQUAL("###ERR###", s);
+    g_free(s);
+
+    n.mantissa = 31415;
+    n.exponent = -1;
+    s = gsb_real_format_string ( n, currency_number, FALSE );
+    CU_ASSERT_STRING_EQUAL("###ERR###", s);
+    g_free(s);
+
+    n.mantissa = 0x7fffffffffffffff + 1;
+    n.exponent = 2;
+    s = gsb_real_format_string ( n, currency_number, FALSE );
+    CU_ASSERT_STRING_EQUAL("###ERR###", s);
+}
+
+
 void gsb_real_cunit__gsb_real_normalize()
 {
     gsb_real a;
@@ -701,6 +710,7 @@ CU_pSuite gsb_real_cunit_create_suite ( void )
       || ( NULL == CU_add_test( pSuite, "of gsb_real_sub()",                 gsb_real_cunit__gsb_real_sub ) )
       || ( NULL == CU_add_test( pSuite, "of gsb_real_mul()",                 gsb_real_cunit__gsb_real_mul ) )
       || ( NULL == CU_add_test( pSuite, "of gsb_real_adjust_exponent()",     gsb_real_cunit__gsb_real_adjust_exponent ) )
+      || ( NULL == CU_add_test( pSuite, "of gsb_real_format_string()",   gsb_real_cunit__gsb_real_format_string ) )
        )
         return NULL;
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list