onqtam | 15c5f0f | 2016-08-02 17:31:27 +0300 | [diff] [blame] | 1 | #include "doctest.h" |
onqtam | cc9e865 | 2016-08-02 14:23:38 +0300 | [diff] [blame] | 2 | |
onqtam | 7cc0e96 | 2017-04-17 23:30:36 +0300 | [diff] [blame] | 3 | #include "header.h" |
| 4 | |
onqtam | c223b69 | 2016-08-02 17:20:06 +0300 | [diff] [blame] | 5 | #include <ostream> |
onqtam | 12d5598 | 2017-04-16 22:35:27 +0300 | [diff] [blame] | 6 | #include <sstream> |
| 7 | |
onqtam | 7cc0e96 | 2017-04-17 23:30:36 +0300 | [diff] [blame] | 8 | /* |
| 9 | |
onqtam | 12d5598 | 2017-04-16 22:35:27 +0300 | [diff] [blame] | 10 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6) |
onqtam | 7cc0e96 | 2017-04-17 23:30:36 +0300 | [diff] [blame] | 11 | //#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" |
onqtam | 12d5598 | 2017-04-16 22:35:27 +0300 | [diff] [blame] | 12 | #endif // > gcc 4.6 |
| 13 | |
| 14 | #ifndef DOCTEST_CONFIG_DISABLE |
onqtam | d9bb03a | 2016-08-02 15:32:49 +0300 | [diff] [blame] | 15 | |
onqtam | 98e12af | 2017-04-16 22:11:21 +0300 | [diff] [blame] | 16 | TEST_CASE("doctest internals") { |
onqtam | 12d5598 | 2017-04-16 22:35:27 +0300 | [diff] [blame] | 17 | using namespace doctest; |
| 18 | |
onqtam | 98e12af | 2017-04-16 22:11:21 +0300 | [diff] [blame] | 19 | // string stuff |
| 20 | doctest::String a(0); |
| 21 | const doctest::String const_str("omgomgomg"); |
| 22 | a = const_str.c_str(); |
| 23 | CHECK(a.size() == const_str.size()); |
| 24 | CHECK(a.length() == const_str.length()); |
| 25 | CHECK(a.compare(const_str, true) == 0); |
| 26 | CHECK(a.compare("omgomgomg", false) == 0); |
| 27 | |
| 28 | // toString |
| 29 | a += toString("aaa") + toString(0.5f) + toString('c') + toString(true) + |
| 30 | toString(static_cast<long double>(0.1)) // |
| 31 | + toString(static_cast<unsigned char>(1)) // |
| 32 | + toString(static_cast<short>(1)) // |
| 33 | + toString(static_cast<long>(1)) // |
| 34 | + toString(static_cast<unsigned long>(1)) // |
| 35 | + toString(static_cast<unsigned short>(1)); |
| 36 | |
| 37 | // others |
onqtam | 12d5598 | 2017-04-16 22:35:27 +0300 | [diff] [blame] | 38 | //a += doctest::detail::fileForOutput("c:\\a"); |
| 39 | //a += doctest::detail::fileForOutput("c:/a"); |
| 40 | //a += doctest::detail::fileForOutput("a"); |
onqtam | 98e12af | 2017-04-16 22:11:21 +0300 | [diff] [blame] | 41 | std::ostringstream oss; |
| 42 | oss << a; |
| 43 | oss << doctest::detail::getAssertString(static_cast<doctest::detail::assertType::Enum>(3)); |
| 44 | a += oss.str().c_str(); |
| 45 | CHECK(doctest::detail::rawMemoryToString(a).length() > 0u); |
onqtam | d9bb03a | 2016-08-02 15:32:49 +0300 | [diff] [blame] | 46 | } |
| 47 | |
onqtam | c79b754 | 2017-04-19 20:47:13 +0300 | [diff] [blame] | 48 | #endif // DOCTEST_CONFIG_DISABLE |
| 49 | |
onqtam | 7cc0e96 | 2017-04-17 23:30:36 +0300 | [diff] [blame] | 50 | */ |