MCPcopy Create free account
hub / github.com/boostorg/leaf / main

Function main

test/diagnostics_test6.cpp:70–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70int main()
71{
72 leaf::try_handle_all([]() -> leaf::result<void>
73 {
74 return f2();
75 },
76 [](leaf::diagnostic_details const & e)
77 {
78#if BOOST_LEAF_CFG_STD_STRING
79 std::ostringstream st;
80 st << e;
81 std::string s = st.str();
82 std::cout << s << std::endl;
83 if( BOOST_LEAF_CFG_DIAGNOSTICS && BOOST_LEAF_CFG_CAPTURE )
84 {
85 BOOST_TEST_EQ(s.find(": 11"), s.npos);
86 BOOST_TEST_NE(s.find(": 12"), s.npos);
87 BOOST_TEST_EQ(s.find(": 21"), s.npos);
88 }
89#endif
90 } );
91
92 leaf::try_handle_all([]() -> leaf::result<void>
93 {
94 return f3();
95 },
96 [](leaf::diagnostic_details const & e)
97 {
98#if BOOST_LEAF_CFG_STD_STRING
99 std::ostringstream st;
100 st << e;
101 std::string s = st.str();
102 std::cout << s << std::endl;
103 if( BOOST_LEAF_CFG_DIAGNOSTICS && BOOST_LEAF_CFG_CAPTURE )
104 {
105 BOOST_TEST_EQ(s.find(": 11"), s.npos);
106 BOOST_TEST_NE(s.find(": 13"), s.npos);
107 BOOST_TEST_EQ(s.find(": 21"), s.npos);
108 }
109#endif
110 } );
111
112 leaf::try_handle_all([]() -> leaf::result<void>
113 {
114 return f4();
115 },
116 [](leaf::diagnostic_details const & e)
117 {
118#if BOOST_LEAF_CFG_STD_STRING
119 std::ostringstream st;
120 st << e;
121 std::string s = st.str();
122 std::cout << s << std::endl;
123 if( BOOST_LEAF_CFG_DIAGNOSTICS && BOOST_LEAF_CFG_CAPTURE )
124 {
125 BOOST_TEST_EQ(s.find(": 12"), s.npos);
126 BOOST_TEST_NE(s.find(": 14"), s.npos);
127 BOOST_TEST_NE(s.find(": 21"), s.npos);

Callers

nothing calls this directly

Calls 5

try_handle_allFunction · 0.85
report_errorsFunction · 0.85
f2Function · 0.70
f3Function · 0.70
f4Function · 0.70

Tested by

no test coverage detected