root/library/tests/unittest-cpp/Checks.cpp @ 699

Revision 477, 1.2 kB (checked in by mido, 15 years ago)

panove, vite, jak jsem peclivej na upravu kodu.. snad se vam bude libit:) konfigurace je v souboru /system/astylerc

Line 
1#include "Checks.h"
2#include <cstring>
3
4namespace UnitTest {
5
6namespace {
7
8void CheckStringsEqual ( TestResults& results, char const* expected, char const* actual,
9                         TestDetails const& details ) {
10        using namespace std;
11
12        if ( strcmp ( expected, actual ) ) {
13                UnitTest::MemoryOutStream stream;
14                stream << "Expected " << expected << " but was " << actual;
15
16                results.OnTestFailure ( details, stream.GetText() );
17        }
18}
19
20}
21
22
23void CheckEqual ( TestResults& results, char const* expected, char const* actual,
24                  TestDetails const& details ) {
25        CheckStringsEqual ( results, expected, actual, details );
26}
27
28void CheckEqual ( TestResults& results, char* expected, char* actual,
29                  TestDetails const& details ) {
30        CheckStringsEqual ( results, expected, actual, details );
31}
32
33void CheckEqual ( TestResults& results, char* expected, char const* actual,
34                  TestDetails const& details ) {
35        CheckStringsEqual ( results, expected, actual, details );
36}
37
38void CheckEqual ( TestResults& results, char const* expected, char* actual,
39                  TestDetails const& details ) {
40        CheckStringsEqual ( results, expected, actual, details );
41}
42
43
44}
Note: See TracBrowser for help on using the browser.