I am writing unit tests with gtest at the moment and want to test if the command line output of a function is correct. It would be best if I could determine what was written exactly but if that is not possible, being able to differentiate if something was written or not would suffice.
The only thing I have available is the pointer to the output stream defined as following:
std::ostream* outStream = &std::cout;
I tried casting outStream to a pointer on a String and the other way around but that (obviously) didn't work and threw SEH exeptions.
I am pretty lost with what to do so even some general advice on what to look into would be helpful.
Thank you for your help.