-
@@ -213,21 +212,28 @@ Here is the call graph for this function:
Self-test implementations.
63 {
-
64
-
-
-
67 1, 1);
-
68
-
-
70 1, 1};
-
-
-
-
74
-
75
-
76
-
-
-
79 5, 15);
-
80
-
-
82 0, 0, 0, 0, 1, 1, 2, 4,
-
83 8, 16, 31, 61, 120, 236, 464};
-
84
-
-
-
-
88
-
89
-
90
-
-
-
93 6, 17);
-
94
-
-
96 0, 0, 0, 0, 0, 1, 1, 2, 4,
-
97 8, 16, 32, 63, 125, 248, 492, 976};
-
98
-
-
-
-
102
-
103
-
-
-
106 56, 15);
-
107
-
-
109 0, 0, 0, 0, 0, 0, 0, 0,
-
110 0, 0, 0, 0, 0, 0, 0};
-
-
-
-
114}
+
69 {
+
70 struct TestCase {
+
71 const uint64_t n;
+
72 const uint64_t m;
+
+
74 TestCase(const uint64_t in_n, const uint64_t in_m,
+
+
76 : n(in_n), m(in_m), expected(
data) {
+
77 assert(
data.size() == m);
+
78 }
+
79 };
+
+
81 TestCase(0, 0, {}),
+
82 TestCase(0, 1, {0}),
+
83 TestCase(0, 2, {0, 0}),
+
84 TestCase(1, 0, {}),
+
85 TestCase(1, 1, {1}),
+
86 TestCase(1, 2, {1, 1}),
+
87 TestCase(1, 3, {1, 1, 1}),
+
88 TestCase(5, 15, {0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 31, 61, 120, 236, 464}),
+
89 TestCase(
+
90 6, 17,
+
91 {0, 0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 32, 63, 125, 248, 492, 976}),
+
92 TestCase(56, 15, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})};
+
93
+
94 for (const auto &tc : test_cases) {
+
95 assert(math::n_bonacci::N_bonacci(tc.n, tc.m) == tc.expected);
+
96 }
+
+
98}
-
-
-
-
std::vector< uint64_t > N_bonacci(const uint64_t &n, const uint64_t &m)
Finds the N-Bonacci series for the n parameter value and m parameter terms.
Definition: n_bonacci.cpp:41
+
int data[MAX]
test data
Definition: hash_search.cpp:24
+
-
diff --git a/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map
index 6fb51286b..cf1353460 100644
--- a/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map
+++ b/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map
@@ -1,7 +1,4 @@
diff --git a/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5
index ece238875..77de60e3f 100644
--- a/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5
+++ b/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5
@@ -1 +1 @@
-100237f3396188af4089a52f8dfab1c0
\ No newline at end of file
+f486c9c49ba8056684cc8746d21a532f
\ No newline at end of file
diff --git a/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg
index 87845970b..268a1ad21 100644
--- a/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg
+++ b/db/d27/n__bonacci_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg
@@ -4,78 +4,33 @@
-