Commit 80c54c95 authored by Arturo Espinosa's avatar Arturo Espinosa
Browse files

Split the format testing from the format code

parent 2120f54e
......@@ -67,7 +67,7 @@ gnumeric_LDADD = \
$(GNOME_XML_LIB) \
$(INTLLIBS)
test_format_SOURCES = format.c
test_format_SOURCES = format.c test-format.c
test_format_LDADD = \
$(GNOME_LIBDIR) \
......
......@@ -42,6 +42,7 @@ gchar *format_number( gdouble number, gchar *format );
supported.
*/
gchar *day_short[] =
{
N_( "Sun" ),
......@@ -96,35 +97,6 @@ gchar *month_long[] =
N_( "December" )
};
void
test()
{
double timec = 36022.63582;
printf( "%s|\n", format_number( 12.3456789, "??0000.00?" ) );
printf( "%s|\n", format_number( 12.3, "??0000.00?" ) );
printf( "%s|\n", format_number( 12345.6789, "??0000.00?" ) );
printf( "%s|\n", format_number( 0.123456789, "???????.00" ) );
printf( "%s|\n", format_number( 12200000, "???0.000??#,," ) );
printf( "%s|\n", format_number( timec, "hh:mm:ss" ) );
printf( "%s|\n", format_number( timec, "mmmm dd, yyyy" ) );
printf( "%s|\n", format_number( timec, "mmm d, yy h:m:s" ) );
printf( "%s|\n", format_number( timec, "mmm d, yy h:m:s PM" ) );
timec += 2 / 24.0;
printf( "%s|\n", format_number( timec, "hh:mm:ss" ) );
printf( "%s|\n", format_number( timec, "mmmm dd, yyyy" ) );
printf( "%s|\n", format_number( timec, "mmm d, yy h:m:s" ) );
printf( "%s|\n", format_number( timec, "mmm d, yy h:m:s PM" ) );
}
int
main( int argc, gchar *argv[] )
{
bindtextdomain(PACKAGE, GNOMELOCALEDIR);
textdomain(PACKAGE);
test();
return 0;
}
static void do_roundup( GString *string )
{
int i;
......
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <gnome.h>
#include <time.h>
void
test()
{
double timec = 36022.63582;
printf( "%s|\n", format_number( 12.3456789, "??0000.00?" ) );
printf( "%s|\n", format_number( 12.3, "??0000.00?" ) );
printf( "%s|\n", format_number( 12345.6789, "??0000.00?" ) );
printf( "%s|\n", format_number( 0.123456789, "???????.00" ) );
printf( "%s|\n", format_number( 12200000, "???0.000??#,," ) );
printf( "%s|\n", format_number( timec, "hh:mm:ss" ) );
printf( "%s|\n", format_number( timec, "mmmm dd, yyyy" ) );
printf( "%s|\n", format_number( timec, "mmm d, yy h:m:s" ) );
printf( "%s|\n", format_number( timec, "mmm d, yy h:m:s PM" ) );
timec += 2 / 24.0;
printf( "%s|\n", format_number( timec, "hh:mm:ss" ) );
printf( "%s|\n", format_number( timec, "mmmm dd, yyyy" ) );
printf( "%s|\n", format_number( timec, "mmm d, yy h:m:s" ) );
printf( "%s|\n", format_number( timec, "mmm d, yy h:m:s PM" ) );
}
int
main( int argc, gchar *argv[] )
{
bindtextdomain(PACKAGE, GNOMELOCALEDIR);
textdomain(PACKAGE);
test();
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment