try changing test output to TRACE
This commit is contained in:
@@ -20,12 +20,12 @@ class MyTest : public deepstate::Test {
|
||||
public:
|
||||
|
||||
void SetUp(void) {
|
||||
LOG(INFO)
|
||||
LOG(TRACE)
|
||||
<< "Setting up!";
|
||||
}
|
||||
|
||||
void TearDown(void) {
|
||||
LOG(INFO)
|
||||
LOG(TRACE)
|
||||
<< "Tearing down!";
|
||||
}
|
||||
|
||||
|
||||
@@ -18,19 +18,20 @@
|
||||
|
||||
TEST(Streaming, BasicLevels) {
|
||||
LOG(DEBUG) << "This is a debug message";
|
||||
LOG(INFO) << "This is an info message";
|
||||
LOG(TRACE) << "This is a trace message";
|
||||
LOG(INFO) << "This is an info message";
|
||||
LOG(WARNING) << "This is a warning message";
|
||||
LOG(ERROR) << "This is a error message";
|
||||
LOG(INFO) << "This is a info message again";
|
||||
LOG(TRACE) << "This is a trace message again";
|
||||
ASSERT(true) << "This should not be printed.";
|
||||
}
|
||||
|
||||
TEST(Streaming, BasicTypes) {
|
||||
LOG(INFO) << 'a';
|
||||
LOG(INFO) << 1;
|
||||
LOG(INFO) << 1.0;
|
||||
LOG(INFO) << "string";
|
||||
LOG(INFO) << nullptr;
|
||||
LOG(TRACE) << 'a';
|
||||
LOG(TRACE) << 1;
|
||||
LOG(TRACE) << 1.0;
|
||||
LOG(TRACE) << "string";
|
||||
LOG(TRACE) << nullptr;
|
||||
}
|
||||
|
||||
TEST(Formatting, OverridePrintf) {
|
||||
|
||||
@@ -34,12 +34,13 @@ struct DeepState_VarArgs {
|
||||
|
||||
enum DeepState_LogLevel {
|
||||
DeepState_LogDebug = 0,
|
||||
DeepState_LogInfo = 1,
|
||||
DeepState_LogWarning = 2,
|
||||
DeepState_LogTrace = 1,
|
||||
DeepState_LogInfo = 2,
|
||||
DeepState_LogWarning = 3,
|
||||
DeepState_LogWarn = DeepState_LogWarning,
|
||||
DeepState_LogError = 3,
|
||||
DeepState_LogExternal = 4,
|
||||
DeepState_LogFatal = 5,
|
||||
DeepState_LogError = 4,
|
||||
DeepState_LogExternal = 5,
|
||||
DeepState_LogFatal = 6,
|
||||
DeepState_LogCritical = DeepState_LogFatal,
|
||||
};
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ static const char *DeepState_LogLevelStr(enum DeepState_LogLevel level) {
|
||||
switch (level) {
|
||||
case DeepState_LogDebug:
|
||||
return "DEBUG";
|
||||
case DeepState_LogTrace:
|
||||
return "TRACE";
|
||||
case DeepState_LogInfo:
|
||||
return "INFO";
|
||||
case DeepState_LogWarning:
|
||||
@@ -136,7 +138,7 @@ void DeepState_LogFormat(enum DeepState_LogLevel level,
|
||||
/* Override libc! */
|
||||
DEEPSTATE_NOINLINE
|
||||
int puts(const char *str) {
|
||||
DeepState_Log(DeepState_LogInfo, str);
|
||||
DeepState_Log(DeepState_LogTrace, str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -144,7 +146,7 @@ DEEPSTATE_NOINLINE
|
||||
int printf(const char *format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||
DeepState_LogVFormat(DeepState_LogTrace, format, args);
|
||||
va_end(args);
|
||||
return 0;
|
||||
}
|
||||
@@ -153,20 +155,20 @@ DEEPSTATE_NOINLINE
|
||||
int __printf_chk(int flag, const char *format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||
DeepState_LogVFormat(DeepState_LogTrace, format, args);
|
||||
va_end(args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEEPSTATE_NOINLINE
|
||||
int vprintf(const char *format, va_list args) {
|
||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||
DeepState_LogVFormat(DeepState_LogTrace, format, args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEEPSTATE_NOINLINE
|
||||
int __vprintf_chk(int flag, const char *format, va_list args) {
|
||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||
DeepState_LogVFormat(DeepState_LogTrace, format, args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -175,7 +177,7 @@ int vfprintf(FILE *file, const char *format, va_list args) {
|
||||
if (stderr == file) {
|
||||
DeepState_LogVFormat(DeepState_LogDebug, format, args);
|
||||
} else if (stdout == file) {
|
||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||
DeepState_LogVFormat(DeepState_LogTrace, format, args);
|
||||
} else {
|
||||
DeepState_LogVFormat(DeepState_LogExternal, format, args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user