Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
basic.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <string>
#include <websocketpp/logger/basic.hpp>
#include <websocketpp/concurrency/none.hpp>
#include <websocketpp/concurrency/basic.hpp>
Include dependency graph for basic.cpp:

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   basic_log
 

Typedefs

typedef websocketpp::log::basic< websocketpp::concurrency::basic, websocketpp::log::alevelbasic_access_log_type
 

Functions

 BOOST_AUTO_TEST_CASE (is_token_char)
 
 BOOST_AUTO_TEST_CASE (access_clear)
 
 BOOST_AUTO_TEST_CASE (basic_concurrency)
 
 BOOST_AUTO_TEST_CASE (copy_constructor)
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   basic_log

Definition at line 28 of file basic.cpp.

Typedef Documentation

◆ basic_access_log_type

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/4]

BOOST_AUTO_TEST_CASE ( access_clear )

Definition at line 57 of file basic.cpp.

57 {
59
60 std::stringstream out;
61 access_log logger(0xffffffff,&out);
62
63 // clear all channels
64 logger.clear_channels(0xffffffff);
65
66 // writes shouldn't happen
68 //std::cout << "|" << out.str() << "|" << std::endl;
69 BOOST_CHECK( out.str().size() == 0 );
70}
Basic logger that outputs to an ostream.
Definition basic.hpp:59
fc::logger logger
static level const devel
Development messages (warning: very chatty)
Definition levels.hpp:141

◆ BOOST_AUTO_TEST_CASE() [2/4]

BOOST_AUTO_TEST_CASE ( basic_concurrency )

Definition at line 72 of file basic.cpp.

72 {
74
75 std::stringstream out;
76 access_log logger(0xffffffff,&out);
77
78 logger.set_channels(0xffffffff);
79
81 //std::cout << "|" << out.str() << "|" << std::endl;
82 BOOST_CHECK( out.str().size() > 0 );
83}

◆ BOOST_AUTO_TEST_CASE() [3/4]

BOOST_AUTO_TEST_CASE ( copy_constructor )

Definition at line 86 of file basic.cpp.

86 {
87 std::stringstream out;
88
89 basic_access_log_type logger1(0xffffffff,&out);
90 basic_access_log_type logger2(logger1);
91
92 logger2.set_channels(0xffffffff);
93 logger2.write(websocketpp::log::alevel::devel,"devel");
94 BOOST_CHECK( out.str().size() > 0 );
95}
Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/4]

BOOST_AUTO_TEST_CASE ( is_token_char )

Definition at line 39 of file basic.cpp.

39 {
41
42 error_log elog;
43
44 BOOST_CHECK( elog.static_test(websocketpp::log::elevel::info ) == true );
45 BOOST_CHECK( elog.static_test(websocketpp::log::elevel::warn ) == true );
46 BOOST_CHECK( elog.static_test(websocketpp::log::elevel::rerror ) == true );
47 BOOST_CHECK( elog.static_test(websocketpp::log::elevel::fatal ) == true );
48
50
51 elog.write(websocketpp::log::elevel::info,"Information");
52 elog.write(websocketpp::log::elevel::warn,"A warning");
54 elog.write(websocketpp::log::elevel::fatal,"A critical error");
55}
#define elog(FORMAT,...)
Definition logger.hpp:130
static level const info
Definition levels.hpp:69
static level const fatal
Definition levels.hpp:78
static level const rerror
Definition levels.hpp:75
static level const warn
Definition levels.hpp:72