-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from garethsb/fix-nmos-slog
Fix slog warning
- Loading branch information
Showing
7 changed files
with
67 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// The first "test" is of course whether the header compiles standalone | ||
#include "nmos/slog.h" | ||
|
||
#include "bst/test/test.h" | ||
|
||
namespace | ||
{ | ||
struct dull_gate | ||
{ | ||
bool pertinent(slog::severity level) const { return true; } | ||
void log(const slog::log_message& message) {} | ||
}; | ||
} | ||
|
||
BST_TEST_CASE(testSlogLog) | ||
{ | ||
dull_gate gate; | ||
const auto str = utility::string_t{ U("foo") }; | ||
const auto it = std::make_pair(nmos::id{ U("bar") }, nmos::types::node); | ||
// log statement | ||
slog::log<SLOG_LOGGING_SEVERITY>(gate, SLOG_FLF) << str << 42 << str; | ||
slog::log<SLOG_LOGGING_SEVERITY>(gate, SLOG_FLF) << it << 42 << it; | ||
// no log statement | ||
slog::log<SLOG_LOGGING_SEVERITY - 1>(gate, SLOG_FLF) << str << 42 << str; | ||
slog::log<SLOG_LOGGING_SEVERITY - 1>(gate, SLOG_FLF) << it << 42 << it; | ||
} |