MCPcopy Create free account
hub / github.com/ETLCPP/etl / main

Function main

test/etl_error_handler/assert_function/test_error_handler.cpp:116–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115//*****************************************************************************
116int main()
117{
118 etl::set_assert_function(assert_function);
119
120 Assert(false);
121 Assert(true);
122 AssertFail();
123
124 AssertAndReturn(false);
125 AssertAndReturn(true);
126 AssertFailAndReturn();
127
128 if (AssertAndReturnValue(false))
129 {
130 ++assert_return_count;
131 }
132
133 if (AssertAndReturnValue(true))
134 {
135 ++assert_return_count;
136 }
137
138 if (AssertFailAndReturnValue())
139 {
140 ++assert_return_count;
141 }
142
143 bool assert_count_passed = (assert_count == 6);
144
145 if (assert_count_passed)
146 {
147 std::cout << "Log Count Passed\n";
148 }
149 else
150 {
151 std::cout << "Log Count Failed\n";
152 }
153
154 bool return_count_passed = (assert_return_count == 4);
155
156 if (return_count_passed)
157 {
158 std::cout << "Return Count Passed\n";
159 }
160 else
161 {
162 std::cout << "Return Count Failed\n";
163 }
164
165 return (assert_count_passed && return_count_passed) ? 0 : 1;
166}

Callers

nothing calls this directly

Calls 7

set_assert_functionFunction · 0.85
AssertFunction · 0.70
AssertFailFunction · 0.70
AssertAndReturnFunction · 0.70
AssertFailAndReturnFunction · 0.70
AssertAndReturnValueFunction · 0.70
AssertFailAndReturnValueFunction · 0.70

Tested by

no test coverage detected