summaryrefslogtreecommitdiffstats
path: root/src/unit_test.c
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-01-21 21:39:31 +0200
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-01-21 21:39:31 +0200
commit4fd1f55a6bfbc3289971d85662bc8da7bcef77c1 (patch)
treede2899362fd7ede1a60aec550dd20a2d3b6bc65e /src/unit_test.c
parentb475c58273d0f76e51ab43d30b5bc31249fdd0d7 (diff)
fixed interpolation spikes on incremental values
Diffstat (limited to 'src/unit_test.c')
-rwxr-xr-xsrc/unit_test.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/unit_test.c b/src/unit_test.c
index 0582819f0c..b1d2501823 100755
--- a/src/unit_test.c
+++ b/src/unit_test.c
@@ -572,6 +572,39 @@ struct test test9 = {
};
// --------------------------------------------------------------------------------------------------------------------
+// test10
+
+struct feed_values test10_feed[] = {
+ { 500000, 1000 },
+ { 600000, 1000 + 600 },
+ { 200000, 1600 + 200 },
+ { 1000000, 1800 + 1000 },
+ { 200000, 2800 + 200 },
+ { 2000000, 3000 + 2000 },
+ { 600000, 5000 + 600 },
+ { 400000, 5600 + 400 },
+ { 900000, 6000 + 900 },
+ { 1000000, 6900 + 1000 },
+};
+
+calculated_number test10_results[] = {
+ 500, 1000, 1000, 1000, 1000, 1000, 1000
+};
+
+struct test test10 = {
+ "test10", // name
+ "test incremental values updated in short and long durations",
+ 1, // update_every
+ 1, // multiplier
+ 1, // divisor
+ RRDDIM_INCREMENTAL, // algorithm
+ 10, // feed entries
+ 7, // result entries
+ test10_feed, // feed
+ test10_results // results
+};
+
+// --------------------------------------------------------------------------------------------------------------------
int run_test(struct test *test)
{
@@ -658,6 +691,9 @@ int run_all_mockup_tests(void)
if(run_test(&test9))
return 1;
+ if(run_test(&test10))
+ return 1;
+
return 0;
}