Why "unexpected output" warnings
I have a C++ library where a class method invocation prints something to std::cout.
This is reported as an "unexpected output" warning by the api-sanity-checker.
Why does this trigger a warnings? Aren't libraries allowed to write something to the console?
I didn't find any explanation for "unexpected output" in the documentation, maybe you can add a bit?
Thanks!
The unexpected output warning means, that function has printed something to stdout, but the name of this function doesn't contain any of these words: print, debug, warn, message, error, fatal. This warning is needed to catch forgotten debug printing in the code of the function if it is not designed to print anything. Also in some cases printing to stdout means that something is going wrong with the function.
What is the name of your function?
Could you please give me a source code of your library (if it's open), so I can adapt the tool to generate more meaningful test cases?
Thanks for the info, this is pretty useful! Can you add the unexpected output warning description to the documentation?
The library I tried the api-sanity-checker on is here: http://gammalib.sourceforge.net