summaryrefslogtreecommitdiffstats
path: root/daemon/unit_test.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:29 +0000
commit17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99 (patch)
tree3e0c96613972e8bb4afdeeb97a034806363ddfa9 /daemon/unit_test.c
parentReleasing debian version 1.18.1-1. (diff)
downloadnetdata-17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99.tar.xz
netdata-17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99.zip
Merging upstream version 1.19.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemon/unit_test.c')
-rw-r--r--daemon/unit_test.c172
1 files changed, 40 insertions, 132 deletions
diff --git a/daemon/unit_test.c b/daemon/unit_test.c
index 31718eeea..2e5927321 100644
--- a/daemon/unit_test.c
+++ b/daemon/unit_test.c
@@ -588,28 +588,28 @@ struct test test4 = {
// test5 - 32 bit overflows
struct feed_values test5_feed[] = {
- { 0, 0x00000000FFFFFFFFULL / 3 * 0 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 1 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 2 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 0 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 1 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 2 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 0 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 1 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 2 },
- { 1000000, 0x00000000FFFFFFFFULL / 3 * 0 },
+ { 0, 0x00000000FFFFFFFFULL / 15 * 0 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 7 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 14 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 0 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 7 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 14 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 0 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 7 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 14 },
+ { 1000000, 0x00000000FFFFFFFFULL / 15 * 0 },
};
calculated_number test5_results[] = {
- 0x00000000FFFFFFFFULL / 3,
- 0x00000000FFFFFFFFULL / 3,
- 0x00000000FFFFFFFFULL / 3,
- 0x00000000FFFFFFFFULL / 3,
- 0x00000000FFFFFFFFULL / 3,
- 0x00000000FFFFFFFFULL / 3,
- 0x00000000FFFFFFFFULL / 3,
- 0x00000000FFFFFFFFULL / 3,
- 0x00000000FFFFFFFFULL / 3,
+ 0x00000000FFFFFFFFULL / 15 * 7,
+ 0x00000000FFFFFFFFULL / 15 * 7,
+ 0x00000000FFFFFFFFULL / 15,
+ 0x00000000FFFFFFFFULL / 15 * 7,
+ 0x00000000FFFFFFFFULL / 15 * 7,
+ 0x00000000FFFFFFFFULL / 15,
+ 0x00000000FFFFFFFFULL / 15 * 7,
+ 0x00000000FFFFFFFFULL / 15 * 7,
+ 0x00000000FFFFFFFFULL / 15,
};
struct test test5 = {
@@ -628,36 +628,36 @@ struct test test5 = {
};
// --------------------------------------------------------------------------------------------------------------------
-// test5b - 16 bit overflows
+// test5b - 64 bit overflows
struct feed_values test5b_feed[] = {
- { 0, 0x000000000000FFFFULL / 3 * 0 },
- { 1000000, 0x000000000000FFFFULL / 3 * 1 },
- { 1000000, 0x000000000000FFFFULL / 3 * 2 },
- { 1000000, 0x000000000000FFFFULL / 3 * 0 },
- { 1000000, 0x000000000000FFFFULL / 3 * 1 },
- { 1000000, 0x000000000000FFFFULL / 3 * 2 },
- { 1000000, 0x000000000000FFFFULL / 3 * 0 },
- { 1000000, 0x000000000000FFFFULL / 3 * 1 },
- { 1000000, 0x000000000000FFFFULL / 3 * 2 },
- { 1000000, 0x000000000000FFFFULL / 3 * 0 },
+ { 0, 0xFFFFFFFFFFFFFFFFULL / 15 * 0 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 7 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 14 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 0 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 7 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 14 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 0 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 7 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 14 },
+ { 1000000, 0xFFFFFFFFFFFFFFFFULL / 15 * 0 },
};
calculated_number test5b_results[] = {
- 0x000000000000FFFFULL / 3,
- 0x000000000000FFFFULL / 3,
- 0x000000000000FFFFULL / 3,
- 0x000000000000FFFFULL / 3,
- 0x000000000000FFFFULL / 3,
- 0x000000000000FFFFULL / 3,
- 0x000000000000FFFFULL / 3,
- 0x000000000000FFFFULL / 3,
- 0x000000000000FFFFULL / 3,
+ 0xFFFFFFFFFFFFFFFFULL / 15 * 7,
+ 0xFFFFFFFFFFFFFFFFULL / 15 * 7,
+ 0xFFFFFFFFFFFFFFFFULL / 15,
+ 0xFFFFFFFFFFFFFFFFULL / 15 * 7,
+ 0xFFFFFFFFFFFFFFFFULL / 15 * 7,
+ 0xFFFFFFFFFFFFFFFFULL / 15,
+ 0xFFFFFFFFFFFFFFFFULL / 15 * 7,
+ 0xFFFFFFFFFFFFFFFFULL / 15 * 7,
+ 0xFFFFFFFFFFFFFFFFULL / 15,
};
struct test test5b = {
"test5b", // name
- "test 16-bit incremental values overflow",
+ "test 64-bit incremental values overflow",
1, // update_every
1, // multiplier
1, // divisor
@@ -671,92 +671,6 @@ struct test test5b = {
};
// --------------------------------------------------------------------------------------------------------------------
-// test5c - 8 bit overflows
-
-struct feed_values test5c_feed[] = {
- { 0, 0x00000000000000FFULL / 3 * 0 },
- { 1000000, 0x00000000000000FFULL / 3 * 1 },
- { 1000000, 0x00000000000000FFULL / 3 * 2 },
- { 1000000, 0x00000000000000FFULL / 3 * 0 },
- { 1000000, 0x00000000000000FFULL / 3 * 1 },
- { 1000000, 0x00000000000000FFULL / 3 * 2 },
- { 1000000, 0x00000000000000FFULL / 3 * 0 },
- { 1000000, 0x00000000000000FFULL / 3 * 1 },
- { 1000000, 0x00000000000000FFULL / 3 * 2 },
- { 1000000, 0x00000000000000FFULL / 3 * 0 },
-};
-
-calculated_number test5c_results[] = {
- 0x00000000000000FFULL / 3,
- 0x00000000000000FFULL / 3,
- 0x00000000000000FFULL / 3,
- 0x00000000000000FFULL / 3,
- 0x00000000000000FFULL / 3,
- 0x00000000000000FFULL / 3,
- 0x00000000000000FFULL / 3,
- 0x00000000000000FFULL / 3,
- 0x00000000000000FFULL / 3,
-};
-
-struct test test5c = {
- "test5c", // name
- "test 8-bit incremental values overflow",
- 1, // update_every
- 1, // multiplier
- 1, // divisor
- RRD_ALGORITHM_INCREMENTAL, // algorithm
- 10, // feed entries
- 9, // result entries
- test5c_feed, // feed
- test5c_results, // results
- NULL, // feed2
- NULL // results2
-};
-
-// --------------------------------------------------------------------------------------------------------------------
-// test5d - 64 bit overflows
-
-struct feed_values test5d_feed[] = {
- { 0, 0xFFFFFFFFFFFFFFFFULL / 3 * 0 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 1 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 2 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 0 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 1 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 2 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 0 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 1 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 2 },
- { 1000000, 0xFFFFFFFFFFFFFFFFULL / 3 * 0 },
-};
-
-calculated_number test5d_results[] = {
- 0xFFFFFFFFFFFFFFFFULL / 3,
- 0xFFFFFFFFFFFFFFFFULL / 3,
- 0xFFFFFFFFFFFFFFFFULL / 3,
- 0xFFFFFFFFFFFFFFFFULL / 3,
- 0xFFFFFFFFFFFFFFFFULL / 3,
- 0xFFFFFFFFFFFFFFFFULL / 3,
- 0xFFFFFFFFFFFFFFFFULL / 3,
- 0xFFFFFFFFFFFFFFFFULL / 3,
- 0xFFFFFFFFFFFFFFFFULL / 3,
-};
-
-struct test test5d = {
- "test5d", // name
- "test 64-bit incremental values overflow",
- 1, // update_every
- 1, // multiplier
- 1, // divisor
- RRD_ALGORITHM_INCREMENTAL, // algorithm
- 10, // feed entries
- 9, // result entries
- test5d_feed, // feed
- test5d_results, // results
- NULL, // feed2
- NULL // results2
-};
-
-// --------------------------------------------------------------------------------------------------------------------
// test6
struct feed_values test6_feed[] = {
@@ -1417,12 +1331,6 @@ int run_all_mockup_tests(void)
if(run_test(&test5b))
return 1;
- if(run_test(&test5c))
- return 1;
-
- if(run_test(&test5d))
- return 1;
-
if(run_test(&test6))
return 1;