-
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.
Fix warning C4239: nonstandard extension used: 'argument': conversion…
… from 'slog::detail::`anonymous-namespace'::log<`anonymous-namespace'::dull_gate,-2147483647>' to 'slog::log_statement &' message : A non-const reference may only be bound to an lvalue
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 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
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; | ||
} |