projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added the /BARCHART option to CROSSTABS
[pspp]
/
tests
/
math
/
decimal-test.c
diff --git
a/tests/math/decimal-test.c
b/tests/math/decimal-test.c
index 3e1e64eaaf419dc15c4caf66d18257357af266f0..e586b19d6915a91445bc98251fa3fa35cfece8b4 100644
(file)
--- a/
tests/math/decimal-test.c
+++ b/
tests/math/decimal-test.c
@@
-21,6
+21,7
@@
#include <assert.h>
#include <string.h>
#include <assert.h>
#include <string.h>
+#include "libpspp/compiler.h"
#include "math/decimal.h"
#include <limits.h>
#include <float.h>
#include "math/decimal.h"
#include <limits.h>
#include <float.h>
@@
-33,7
+34,7
@@
This function is used purely for testing, and need not and is not intended
to be efficient.
*/
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;
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 */
/* 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;
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);
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;
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);
}
}
decimal_add (&tick, interval);
}
}
+#endif
-void
+
static
void
test_ceil (double x)
{
struct decimal dx;
test_ceil (double x)
{
struct decimal dx;
@@
-168,7
+171,7
@@
test_ceil (double x)
assert (act == expected);
}
assert (act == expected);
}
-void
+
static
void
test_floor (double x)
{
struct decimal dx;
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_;
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);
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];
test_multiplication (const struct decimal *d, int m)
{
char b1[256];
@@
-221,7
+222,7
@@
test_multiplication (const struct decimal *d, int m)
int
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. */
{
/* Test that our canonicalise function works for all corner cases we
can think of. */