| 83 | } |
| 84 | |
| 85 | TEST(alog, example) { |
| 86 | log_output = &log_output_test; |
| 87 | DEFER(log_output = log_output_stdout); |
| 88 | LOG_INFO("WTF" |
| 89 | " is `" |
| 90 | " this `", "exactly", "stuff"); |
| 91 | EXPECT_STREQ("WTF\" \" is exactly\" \" this stuff", log_output_test.log_start()); |
| 92 | |
| 93 | LOG_INFO("WTF is ` this `", 1, 2); |
| 94 | EXPECT_STREQ("WTF is 1 this 2", log_output_test.log_start()); |
| 95 | LOG_INFO("WTF is \n means ` may be work `", "??", "!!"); |
| 96 | EXPECT_STREQ("WTF is \\n means ?? may be work !!", log_output_test.log_start()); |
| 97 | LOG_INFO("WTF is \n means ` may be work `", "??", "!!"); |
| 98 | EXPECT_STREQ("WTF is \\n means ?? may be work !!", log_output_test.log_start()); |
| 99 | const char foobar[] = "n"; |
| 100 | LOG_INFO(foobar); |
| 101 | // #S len == 6 > 2 + sizeof(yeah) 4, will fit the length condition |
| 102 | // but miss the leading/tailing character condition; |
| 103 | EXPECT_STREQ("n", log_output_test.log_start()); |
| 104 | LOG_INFO(VALUE(foobar)); |
| 105 | EXPECT_STREQ("[foobar=n]", log_output_test.log_start()); |
| 106 | } |
| 107 | |
| 108 | struct BeforeAndAfter { |
| 109 | BeforeAndAfter() { |
nothing calls this directly
no test coverage detected