MCPcopy Create free account
hub / github.com/bombela/backward-cpp / fib

Function fib

test/rectrace.cpp:78–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78int fib(StackTrace &st, int level) {
79 if (level == 2) {
80 return 1;
81 }
82 if (level <= 1) {
83 end_of_our_journey(st);
84 return 0;
85 }
86 return fib(st, level - 1) + fib(st, level - 2);
87}
88
89TEST(fibrecursive) {
90 StackTrace st;

Callers 1

TESTFunction · 0.85

Calls 1

end_of_our_journeyFunction · 0.85

Tested by

no test coverage detected