src/testing.cpp defines a debug helper and a debugFlag that gates it, but neither is exercised by the sample program:
bool debugFlag = true;
/**
* Log a debug message to the console.
*/
void debug(std::string message) {
if (debugFlag) {
std::cout << "[DEBUG] " << message << std::endl;
}
}
int main() {
std::string toPrint = "Hello World!";
log(toPrint);
return 0;
}
A grep over the file confirms that debug appears only in its own definition and doc comment, and that debugFlag is read only from inside debug. Running the built binary therefore demonstrates log and nothing else, so the debugFlag gate is never shown to work either way.
Since the sample program is the only demonstration this template offers that it builds and runs correctly, a helper that is shipped but never demonstrated is a gap: it is neither exercised nor removed.
Proposed resolution: either call debug from main so that running ./testing demonstrates both log levels, or delete debug and debugFlag if a minimal sample is preferred. Calling it is suggested, as the flag-gated pattern is the more useful thing for a template to show.
Note that this change alters program output, so whoever implements it should build and run the binary to record the new expected output.
This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson
src/testing.cppdefines adebughelper and adebugFlagthat gates it, but neither is exercised by the sample program:A grep over the file confirms that
debugappears only in its own definition and doc comment, and thatdebugFlagis read only from insidedebug. Running the built binary therefore demonstrateslogand nothing else, so thedebugFlaggate is never shown to work either way.Since the sample program is the only demonstration this template offers that it builds and runs correctly, a helper that is shipped but never demonstrated is a gap: it is neither exercised nor removed.
Proposed resolution: either call
debugfrommainso that running./testingdemonstrates both log levels, or deletedebuganddebugFlagif a minimal sample is preferred. Calling it is suggested, as the flag-gated pattern is the more useful thing for a template to show.Note that this change alters program output, so whoever implements it should build and run the binary to record the new expected output.
This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson