[gnumeric] tests: lower the rate of failure for normal tests.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] tests: lower the rate of failure for normal tests.
- Date: Sat, 10 Mar 2012 21:47:17 +0000 (UTC)
commit 0ab3bd739c2a803bda219ceef508aabd1c67c456
Author: Morten Welinder <terra gnome org>
Date: Sat Mar 10 16:46:54 2012 -0500
tests: lower the rate of failure for normal tests.
ChangeLog | 3 +++
src/sstest.c | 11 ++++++-----
test/ChangeLog | 2 ++
test/GnumericTest.pm | 5 +++++
4 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 24f1de6..a89e677 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2012-03-10 Morten Welinder <terra gnome org>
+ * src/sstest.c (test_random): Use more samples for normal tests to
+ reduce failure rates.
+
* src/xml-sax-write.c (xml_write_colrow_info): Don't write records
that match the default col/row style.
(gnm_xml_out_add_gocolor): Don't go through GdkRGBA which causes
diff --git a/src/sstest.c b/src/sstest.c
index 008f682..a4f57ad 100644
--- a/src/sstest.c
+++ b/src/sstest.c
@@ -639,7 +639,7 @@ test_random_randbernoulli (int N)
static void
test_random_randnorm (int N)
{
- gnm_float mean, var, adtest, cvmtest, lkstest, sftest;
+ gnm_float mean, var, adtest, cvmtest, lkstest, sftest;
gnm_float mean_target = 0, var_target = 1;
gnm_float *vals;
gboolean ok;
@@ -673,7 +673,7 @@ test_random_randnorm (int N)
g_printerr ("CramÃr-von Mises Test rejected [%.10" GNM_FORMAT_g "]\n", cvmtest);
ok = FALSE;
}
- if (lkstest < 0.05) {
+ if (lkstest < 0.01) {
g_printerr ("Lilliefors (Kolmogorov-Smirnov) Test rejected [%.10" GNM_FORMAT_g "]\n",
lkstest);
ok = FALSE;
@@ -726,7 +726,7 @@ test_random_randsnorm (int N)
ok = FALSE;
}
T = 2*(M_PIgnum - 3)*mean_target*mean_target*mean_target*mean_target/(var_target*var_target);
- if (gnm_abs (kurt - T) > 0.10) {
+ if (gnm_abs (kurt - T) > 0.15) {
g_printerr ("Kurt failure [%.10" GNM_FORMAT_g "]\n", T);
ok = FALSE;
}
@@ -740,12 +740,13 @@ test_random (void)
{
const char *test_name = "test_random";
const int N = 20000;
+ const int High_N = 65000;
mark_test_start (test_name);
test_random_rand (N);
test_random_randbernoulli (N);
- test_random_randnorm (N);
- test_random_randsnorm (N);
+ test_random_randnorm (High_N);
+ test_random_randsnorm (High_N);
#if 0
test_random_randbeta (N);
test_random_randbetween (N);
diff --git a/test/ChangeLog b/test/ChangeLog
index 2d8eba8..fde7063 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,6 +1,8 @@
2012-03-10 Morten Welinder <terra gnome org>
* normalize-gnumeric: Block out odf version.
+ * GnumericTest.pm (sstest): When failing and using predicate,
+ print entire failure output.
2012-03-02 Morten Welinder <terra gnome org>
diff --git a/test/GnumericTest.pm b/test/GnumericTest.pm
index e9b11e2..e12f5ba 100644
--- a/test/GnumericTest.pm
+++ b/test/GnumericTest.pm
@@ -152,6 +152,11 @@ sub sstest {
if (ref $expected) {
local $_ = $actual;
$ok = &$expected ($_);
+ if (!$ok) {
+ foreach (split ("\n", $actual)) {
+ print "| $_\n";
+ }
+ }
} else {
my @actual = split ("\n", $actual);
chomp @actual;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]