Fixes one or two subtle issues. But the more interesting fix is that I implemented puts in terms of DeepState_Log. Calls to printf that had no format arguments are transformed by the compiler into calls to puts, but that wasn't being wrapped by DeepState, so it was appearing as though those log messages never actually happened.

This commit is contained in:
Peter Goodman
2017-12-12 14:01:41 -05:00
parent c65b0c7ba4
commit e9bd6dc177
4 changed files with 47 additions and 39 deletions

View File

@@ -15,7 +15,7 @@
*/
#include <deepstate/DeepState.hpp>
/*
TEST(Streaming, BasicLevels) {
LOG(DEBUG) << "This is a debug message";
LOG(INFO) << "This is an info message";
@@ -32,11 +32,12 @@ TEST(Streaming, BasicTypes) {
LOG(INFO) << "string";
LOG(INFO) << nullptr;
}
*/
TEST(Formatting, OverridePrintf) {
printf("hello string=%s hex_lower=%x hex_upper=%X octal=%o char=%c dec=%d"
"double=%f sci=%e SCI=%E pointer=%p",
"world", 999, 999, 999, 'a', 999, 999.0, 999.0, 999.0, "world");
printf("hello again!");
}
int main(void) {