MCPcopy Create free account
hub / github.com/Compaile/ctrack / recursive_factorial

Function recursive_factorial

test/test_nested.cpp:12–20  ·  view source on GitHub ↗

Recursive factorial function for testing recursive scenarios

Source from the content-addressed store, hash-verified

10
11// Recursive factorial function for testing recursive scenarios
12int recursive_factorial(int n) {
13 CTRACK;
14 if (n <= 1) {
15 test_helpers::sleep_ms(5); // Small work at base case
16 return 1;
17 }
18 test_helpers::sleep_ms(5); // Work at each level
19 return n * recursive_factorial(n - 1);
20}
21
22// Recursive fibonacci for testing deep recursion with branching
23int recursive_fibonacci(int n) {

Callers 1

test_nested.cppFile · 0.70

Calls 1

sleep_msFunction · 0.85

Tested by

no test coverage detected