X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fmath%2Fdecimal-test.c;h=e586b19d6915a91445bc98251fa3fa35cfece8b4;hb=97fb55e07cac602cbca57ce8005de5c8a67a73cc;hp=3e1e64eaaf419dc15c4caf66d18257357af266f0;hpb=6e44fb76d15ebc34122753b8a7a7d4a1b82bcb43;p=pspp diff --git a/tests/math/decimal-test.c b/tests/math/decimal-test.c index 3e1e64eaaf..e586b19d69 100644 --- a/tests/math/decimal-test.c +++ b/tests/math/decimal-test.c @@ -21,6 +21,7 @@ #include #include +#include "libpspp/compiler.h" #include "math/decimal.h" #include #include @@ -33,7 +34,7 @@ This function is used purely for testing, and need not and is not intended to be efficient. */ -char * +static char * canonicalise_string (const char *s) { char *out; @@ -109,7 +110,7 @@ canonicalise_string (const char *s) /* Tests both the decimal_to_string function, and the decimal_input_from_string function */ -void +static void test_run (const char *input) { struct decimal test; @@ -131,7 +132,7 @@ test_run (const char *input) } -void +static void test_can (const char *in, const char *soll) { char *ist = canonicalise_string (in); @@ -142,7 +143,8 @@ test_can (const char *in, const char *soll) } -void +#if 0 +static void dump_scale (const struct decimal *low, const struct decimal *interval, int n_ticks) { int i; @@ -154,10 +156,11 @@ dump_scale (const struct decimal *low, const struct decimal *interval, int n_tic decimal_add (&tick, interval); } } +#endif -void +static void test_ceil (double x) { struct decimal dx; @@ -168,7 +171,7 @@ test_ceil (double x) assert (act == expected); } -void +static void test_floor (double x) { struct decimal dx; @@ -180,12 +183,10 @@ test_floor (double x) } -void +static void test_addition (const struct decimal *one_, const struct decimal *two) { struct decimal one = *one_; - double d1 = decimal_to_double (&one); - double d2 = decimal_to_double (two); decimal_add (&one, two); @@ -201,7 +202,7 @@ test_addition (const struct decimal *one_, const struct decimal *two) } -void +static void test_multiplication (const struct decimal *d, int m) { char b1[256]; @@ -221,7 +222,7 @@ test_multiplication (const struct decimal *d, int m) int -main (int argc, char **argv) +main (int argc UNUSED, char **argv UNUSED) { /* Test that our canonicalise function works for all corner cases we can think of. */