diff --git a/src/convert/inttostr.cpp b/src/convert/inttostr.cpp index 948ce15..b9a8d6d 100644 --- a/src/convert/inttostr.cpp +++ b/src/convert/inttostr.cpp @@ -38,7 +38,7 @@ #include "inttostr.h" -namespace PT +namespace pt { std::string to_str(unsigned long long value, int base) diff --git a/src/convert/inttostr.h b/src/convert/inttostr.h index 27e2496..f134dc8 100644 --- a/src/convert/inttostr.h +++ b/src/convert/inttostr.h @@ -42,7 +42,7 @@ -namespace PT +namespace pt { diff --git a/src/convert/misc.cpp b/src/convert/misc.cpp index a6cf0d7..978cce7 100644 --- a/src/convert/misc.cpp +++ b/src/convert/misc.cpp @@ -38,7 +38,7 @@ #include "misc.h" -namespace PT +namespace pt { diff --git a/src/convert/misc.h b/src/convert/misc.h index 4f9ba87..7dbb128 100644 --- a/src/convert/misc.h +++ b/src/convert/misc.h @@ -42,7 +42,7 @@ #include "text.h" -namespace PT +namespace pt { void SetOverflow(bool * was_overflow, bool val); diff --git a/src/convert/patternreplacer.h b/src/convert/patternreplacer.h index 0d89a8f..65569f0 100644 --- a/src/convert/patternreplacer.h +++ b/src/convert/patternreplacer.h @@ -44,7 +44,7 @@ -namespace PT +namespace pt { template diff --git a/src/convert/strtoint.h b/src/convert/strtoint.h index 3324d3a..9d06f4b 100644 --- a/src/convert/strtoint.h +++ b/src/convert/strtoint.h @@ -43,7 +43,7 @@ #include "misc.h" -namespace PT +namespace pt { diff --git a/src/convert/text.cpp b/src/convert/text.cpp index c8d8fa0..8551ba0 100644 --- a/src/convert/text.cpp +++ b/src/convert/text.cpp @@ -40,7 +40,7 @@ #include "text_private.h" -namespace PT +namespace pt { // white_chars table should be sorted (a binary search algorithm is used to find a character) diff --git a/src/convert/text.h b/src/convert/text.h index d698047..d5dcdf2 100644 --- a/src/convert/text.h +++ b/src/convert/text.h @@ -41,7 +41,7 @@ #include -namespace PT +namespace pt { bool is_white(wchar_t c, bool check_additional_chars = true, bool treat_new_line_as_white = true); diff --git a/src/convert/text_private.h b/src/convert/text_private.h index 5957367..2b93ac4 100644 --- a/src/convert/text_private.h +++ b/src/convert/text_private.h @@ -42,7 +42,7 @@ #include "text.h" -namespace PT +namespace pt { namespace pt_private @@ -302,7 +302,7 @@ bool is_substr_nc_generic(const StringType1 * short_str, const StringType2 * lon } // namespace pt_private -} // namespace PT +} // namespace pt #endif diff --git a/src/csv/csvparser.cpp b/src/csv/csvparser.cpp index 81fcf7e..cd2f345 100644 --- a/src/csv/csvparser.cpp +++ b/src/csv/csvparser.cpp @@ -40,7 +40,7 @@ -namespace PT +namespace pt { @@ -81,7 +81,7 @@ CSVParser::Status CSVParser::parse_file(const wchar_t * file_name, Space & out_s { std::string file_name_utf8; - PT::WideToUTF8(file_name, file_name_utf8); + WideToUTF8(file_name, file_name_utf8); return parse_file(file_name_utf8.c_str(), out_space); } @@ -295,7 +295,7 @@ bool correct; do { - PT::UTF8ToInt(file, c, correct); + UTF8ToInt(file, c, correct); if( !file ) return lastc; @@ -348,7 +348,7 @@ bool correct; do { - size_t len = PT::UTF8ToInt(pchar_ascii, c, correct); + size_t len = UTF8ToInt(pchar_ascii, c, correct); pchar_ascii += len; } while( *pchar_ascii && !correct ); diff --git a/src/csv/csvparser.h b/src/csv/csvparser.h index 7402896..8370867 100644 --- a/src/csv/csvparser.h +++ b/src/csv/csvparser.h @@ -43,7 +43,7 @@ #include -namespace PT +namespace pt { /* diff --git a/src/date/date.cpp b/src/date/date.cpp index 1e79c39..6ba05d4 100644 --- a/src/date/date.cpp +++ b/src/date/date.cpp @@ -41,7 +41,7 @@ #include -namespace PT +namespace pt { diff --git a/src/date/date.h b/src/date/date.h index f17b7ab..59938c3 100644 --- a/src/date/date.h +++ b/src/date/date.h @@ -44,7 +44,7 @@ -namespace PT +namespace pt { diff --git a/src/log/filelog.cpp b/src/log/filelog.cpp index 82c1cb7..ff9b82c 100644 --- a/src/log/filelog.cpp +++ b/src/log/filelog.cpp @@ -39,7 +39,7 @@ -namespace PT +namespace pt { @@ -74,7 +74,7 @@ void FileLog::init(const std::wstring & log_file, bool log_stdout, int log_level this->log_stdout = log_stdout; this->log_level = log_level; this->save_each_line = save_each_line; - PT::WideToUTF8(log_file, this->log_file); + WideToUTF8(log_file, this->log_file); } @@ -100,7 +100,7 @@ void FileLog::open_file() } -void FileLog::save_log(PT::WTextStream * buffer) +void FileLog::save_log(WTextStream * buffer) { if( buffer->empty() ) return; @@ -111,7 +111,7 @@ void FileLog::save_log(PT::WTextStream * buffer) { if( log_stdout ) { - PT::WideStreamToUTF8(*buffer, std::cout); + WideStreamToUTF8(*buffer, std::cout); } if( !log_file.empty() ) @@ -126,7 +126,7 @@ void FileLog::save_log(PT::WTextStream * buffer) if( file ) { - PT::WideStreamToUTF8(*buffer, file); + WideStreamToUTF8(*buffer, file); file.flush(); } } diff --git a/src/log/filelog.h b/src/log/filelog.h index abf6555..07f8701 100644 --- a/src/log/filelog.h +++ b/src/log/filelog.h @@ -42,7 +42,7 @@ #include "textstream/textstream.h" -namespace PT +namespace pt { @@ -55,7 +55,7 @@ public: virtual ~FileLog(); virtual void init(const std::wstring & log_file, bool log_stdout, int log_level, bool save_each_line); - virtual void save_log(PT::WTextStream * buffer); + virtual void save_log(WTextStream * buffer); virtual int get_log_level(); virtual bool should_save_each_line(); diff --git a/src/log/log.cpp b/src/log/log.cpp index 757c9cb..34010ee 100644 --- a/src/log/log.cpp +++ b/src/log/log.cpp @@ -45,7 +45,7 @@ #include "morm.h" #endif -namespace PT +namespace pt { @@ -73,13 +73,13 @@ Log::~Log() } -void Log::SetLogBuffer(PT::WTextStream * buffer) +void Log::SetLogBuffer(WTextStream * buffer) { this->buffer = buffer; } -PT::WTextStream * Log::GetLogBuffer() +WTextStream * Log::GetLogBuffer() { return buffer; } @@ -136,7 +136,7 @@ Log & Log::operator<<(const char * s) { if( buffer && file_log && s && current_level <= file_log->get_log_level() ) { - PT::UTF8ToWide(s, *buffer, false); + UTF8ToWide(s, *buffer, false); } return *this; @@ -148,7 +148,7 @@ Log & Log::operator<<(const std::string & s) { if( buffer && file_log && current_level <= file_log->get_log_level() ) { - PT::UTF8ToWide(s, *buffer, false); + UTF8ToWide(s, *buffer, false); } return *this; @@ -160,7 +160,7 @@ Log & Log::operator<<(const std::string * s) { if( buffer && file_log && current_level <= file_log->get_log_level() ) { - PT::UTF8ToWide(*s, *buffer, false); + UTF8ToWide(*s, *buffer, false); } return *this; @@ -290,7 +290,7 @@ Log & Log::operator<<(double s) -Log & Log::operator<<(const PT::Space & s) +Log & Log::operator<<(const Space & s) { if( buffer && file_log && current_level <= file_log->get_log_level() ) { @@ -302,7 +302,7 @@ Log & Log::operator<<(const PT::Space & s) -Log & Log::operator<<(const PT::Date & date) +Log & Log::operator<<(const Date & date) { if( buffer && file_log && current_level <= file_log->get_log_level() ) { diff --git a/src/log/log.h b/src/log/log.h index 891fb6d..d5073ae 100644 --- a/src/log/log.h +++ b/src/log/log.h @@ -51,7 +51,7 @@ namespace morm } -namespace PT +namespace pt { @@ -93,8 +93,8 @@ public: Log(); virtual ~Log(); - virtual void SetLogBuffer(PT::WTextStream * buffer); - virtual PT::WTextStream * GetLogBuffer(); + virtual void SetLogBuffer(WTextStream * buffer); + virtual WTextStream * GetLogBuffer(); void SetFileLog(FileLog * file_log); FileLog * GetFileLog(); @@ -128,8 +128,8 @@ public: //virtual Log & operator<<(float s); // added virtual Log & operator<<(double s); - virtual Log & operator<<(const PT::Space & space); - virtual Log & operator<<(const PT::Date & date); + virtual Log & operator<<(const Space & space); + virtual Log & operator<<(const Date & date); #ifdef PT_HAS_MORM virtual Log & operator<<(morm::Model & model); @@ -145,7 +145,7 @@ public: template - Log & operator<<(const PT::TextStreamBase & buf); + Log & operator<<(const TextStreamBase & buf); @@ -157,7 +157,7 @@ public: protected: // buffer for the log - PT::WTextStream * buffer; + WTextStream * buffer; // file logger FileLog * file_log; @@ -205,7 +205,7 @@ Log & Log::log_string_generic(const StringType & value, size_t max_size) template -Log & Log::operator<<(const PT::TextStreamBase & buf) +Log & Log::operator<<(const TextStreamBase & buf) { if( buffer && file_log && current_level <= file_log->get_log_level() ) { diff --git a/src/mainoptions/mainoptionsparser.cpp b/src/mainoptions/mainoptionsparser.cpp index 05044bd..685674b 100644 --- a/src/mainoptions/mainoptionsparser.cpp +++ b/src/mainoptions/mainoptionsparser.cpp @@ -42,7 +42,7 @@ -namespace PT +namespace pt { @@ -165,7 +165,7 @@ void MainOptionsParser::convert_str(const char * src, std::wstring & dst) { if( should_use_utf8 ) { - PT::UTF8ToWide(src, dst); + UTF8ToWide(src, dst); } else { @@ -181,7 +181,7 @@ void MainOptionsParser::convert_str(const char * src, size_t len, std::wstring & { if( should_use_utf8 ) { - PT::UTF8ToWide(src, len, dst); + UTF8ToWide(src, len, dst); } else { diff --git a/src/mainoptions/mainoptionsparser.h b/src/mainoptions/mainoptionsparser.h index 97d0147..0930dc3 100644 --- a/src/mainoptions/mainoptionsparser.h +++ b/src/mainoptions/mainoptionsparser.h @@ -43,7 +43,7 @@ #include -namespace PT +namespace pt { diff --git a/src/membuffer/membuffer.h b/src/membuffer/membuffer.h index dea0493..8c14010 100644 --- a/src/membuffer/membuffer.h +++ b/src/membuffer/membuffer.h @@ -41,7 +41,7 @@ #include -namespace PT +namespace pt { /* diff --git a/src/space/space.cpp b/src/space/space.cpp index d40d6b5..f2b7b79 100644 --- a/src/space/space.cpp +++ b/src/space/space.cpp @@ -42,7 +42,7 @@ #include "convert/convert.h" -namespace PT +namespace pt { Space::Space() @@ -922,7 +922,7 @@ std::string Space::to_str() const if( type == type_wstring ) { - PT::TextStream stream; + TextStream stream; serialize_string_buffer(value.value_wstring.c_str(), stream, Escape::no_escape); stream.to_string(str); return str; @@ -942,7 +942,7 @@ std::wstring Space::to_wstr() const if( type == type_string ) { - PT::UTF8ToWide(value.value_string, str); + UTF8ToWide(value.value_string, str); return str; } @@ -1277,7 +1277,7 @@ std::wstring Space::serialize_to_space_wstr(bool pretty_print) const void Space::serialize_to_space_to(std::string & str, bool pretty_print) const { - PT::TextStream stream; + TextStream stream; serialize_to_space_stream(stream, pretty_print); stream.to_string(str); @@ -1286,7 +1286,7 @@ void Space::serialize_to_space_to(std::string & str, bool pretty_print) const void Space::serialize_to_space_to(std::wstring & str, bool pretty_print) const { - PT::WTextStream stream; + WTextStream stream; serialize_to_space_stream(stream, pretty_print); stream.to_string(str); @@ -1312,7 +1312,7 @@ std::wstring Space::serialize_to_json_wstr() const void Space::serialize_to_json_to(std::string & str) const { - PT::TextStream stream; + TextStream stream; serialize_to_json_stream(stream); stream.to_string(str); @@ -1321,7 +1321,7 @@ void Space::serialize_to_json_to(std::string & str) const void Space::serialize_to_json_to(std::wstring & str) const { - PT::WTextStream stream; + WTextStream stream; serialize_to_json_stream(stream); stream.to_string(str); @@ -1429,7 +1429,7 @@ bool Space::has_value(const char * val) const { for(size_t i=0 ; i < value.value_table.size() ; ++i) { - PT::Space * table_item = value.value_table[i]; + Space * table_item = value.value_table[i]; if( table_item->type == type_string ) { @@ -1459,7 +1459,7 @@ bool Space::has_value(const wchar_t * val) const { for(size_t i=0 ; i < value.value_table.size() ; ++i) { - PT::Space * table_item = value.value_table[i]; + Space * table_item = value.value_table[i]; if( table_item->type == type_wstring ) { @@ -1934,7 +1934,7 @@ void Space::remove_child_space(const wchar_t * name) { for(size_t i=0 ; isize() ; ) { - PT::Space * child = (*child_spaces)[i]; + Space * child = (*child_spaces)[i]; if( child->name && (*child->name) == name ) { @@ -1960,7 +1960,7 @@ void Space::remove_child_space(size_t index) { if( child_spaces && index < child_spaces->size() ) { - PT::Space * child = (*child_spaces)[index]; + Space * child = (*child_spaces)[index]; delete child; child = nullptr; diff --git a/src/space/space.h b/src/space/space.h index 5ebc4e9..0278803 100644 --- a/src/space/space.h +++ b/src/space/space.h @@ -50,7 +50,7 @@ -namespace PT +namespace pt { @@ -915,7 +915,7 @@ protected: wchar_t buffer[50]; size_t buffer_len = sizeof(buffer) / sizeof(wchar_t); - PT::Toa(value.value_long, buffer, buffer_len); + Toa(value.value_long, buffer, buffer_len); serialize_string_buffer(buffer, str, Escape::escape_space); } @@ -1095,7 +1095,7 @@ protected: wchar_t buffer[50]; size_t buffer_len = sizeof(buffer) / sizeof(wchar_t); - PT::Toa(value.value_long, buffer, buffer_len); + Toa(value.value_long, buffer, buffer_len); serialize_string_buffer(buffer, str, Escape::escape_json); } diff --git a/src/space/spaceparser.cpp b/src/space/spaceparser.cpp index 7784649..b36ef41 100644 --- a/src/space/spaceparser.cpp +++ b/src/space/spaceparser.cpp @@ -42,7 +42,7 @@ #include "convert/strtoint.h" -namespace PT +namespace pt { @@ -145,7 +145,7 @@ SpaceParser::Status SpaceParser::ParseJSONFile(const wchar_t * file_name) { std::string file_name_utf8; - PT::WideToUTF8(file_name, file_name_utf8); + WideToUTF8(file_name, file_name_utf8); return ParseJSONFile(file_name_utf8.c_str()); } @@ -195,7 +195,7 @@ SpaceParser::Status SpaceParser::ParseSpaceFile(const wchar_t * file_name) { std::string file_name_utf8; - PT::WideToUTF8(file_name, file_name_utf8); + WideToUTF8(file_name, file_name_utf8); return ParseSpaceFile(file_name_utf8.c_str()); } @@ -972,7 +972,7 @@ bool correct; do { - PT::UTF8ToInt(file, c, correct); + UTF8ToInt(file, c, correct); if( !file ) return lastc; @@ -1025,7 +1025,7 @@ bool correct; do { - size_t len = PT::UTF8ToInt(pchar_ascii, c, correct); + size_t len = UTF8ToInt(pchar_ascii, c, correct); pchar_ascii += len; } while( *pchar_ascii && !correct ); diff --git a/src/space/spaceparser.h b/src/space/spaceparser.h index d93fbf1..20c24f1 100644 --- a/src/space/spaceparser.h +++ b/src/space/spaceparser.h @@ -43,7 +43,7 @@ -namespace PT +namespace pt { diff --git a/src/textstream/textstream.h b/src/textstream/textstream.h index 9b49589..1ad96cc 100644 --- a/src/textstream/textstream.h +++ b/src/textstream/textstream.h @@ -49,7 +49,7 @@ // for snprintf #include -namespace PT +namespace pt { @@ -109,8 +109,8 @@ public: TextStreamBase & operator<<(unsigned long long); TextStreamBase & operator<<(double); TextStreamBase & operator<<(const void *); // printing a pointer - TextStreamBase & operator<<(const PT::Space & space); - TextStreamBase & operator<<(const PT::Date & date); + TextStreamBase & operator<<(const Space & space); + TextStreamBase & operator<<(const Date & date); // min width for integer output // if the output value has less digits then first zeroes are added @@ -469,7 +469,7 @@ wchar_t buf[100]; template TextStreamBase & -TextStreamBase::operator<<(const PT::Space & space) +TextStreamBase::operator<<(const Space & space) { space.serialize_to_space_stream(*this, true); @@ -480,7 +480,7 @@ return *this; template TextStreamBase & -TextStreamBase::operator<<(const PT::Date & date) +TextStreamBase::operator<<(const Date & date) { date.Serialize(*this); diff --git a/src/textstream/types.h b/src/textstream/types.h index d2fe229..dbb84a0 100644 --- a/src/textstream/types.h +++ b/src/textstream/types.h @@ -40,7 +40,7 @@ -namespace PT +namespace pt { diff --git a/src/utf8/utf8.cpp b/src/utf8/utf8.cpp index 6090e59..5ed9e19 100644 --- a/src/utf8/utf8.cpp +++ b/src/utf8/utf8.cpp @@ -40,7 +40,7 @@ -namespace PT +namespace pt { diff --git a/src/utf8/utf8.h b/src/utf8/utf8.h index 979dd9e..fecd2eb 100644 --- a/src/utf8/utf8.h +++ b/src/utf8/utf8.h @@ -42,7 +42,7 @@ #include "textstream/textstream.h" -namespace PT +namespace pt { /*! diff --git a/src/utf8/utf8_private.cpp b/src/utf8/utf8_private.cpp index 71248d0..1394ebb 100644 --- a/src/utf8/utf8_private.cpp +++ b/src/utf8/utf8_private.cpp @@ -38,7 +38,7 @@ #include "utf8_private.h" -namespace PT +namespace pt { namespace private_namespace @@ -277,7 +277,7 @@ return chars; } // namespace private_namespace -} // namespace PT +} // namespace pt diff --git a/src/utf8/utf8_private.h b/src/utf8/utf8_private.h index 909d834..9b0b7f3 100644 --- a/src/utf8/utf8_private.h +++ b/src/utf8/utf8_private.h @@ -41,7 +41,7 @@ #include "textstream/textstream.h" -namespace PT +namespace pt { bool UTF8_CheckRange(int c); @@ -138,7 +138,7 @@ bool correct, was_error = false; } else { - len = PT::UTF8ToInt(utf8, utf8_len, z, correct); // the len will be different from zero + len = pt::UTF8ToInt(utf8, utf8_len, z, correct); // the len will be different from zero } if( !correct ) @@ -215,6 +215,6 @@ void WideToUTF8Generic(TextStreamBase & } // namespace private_namespace -} // namespace PT +} // namespace pt #endif diff --git a/src/utf8/utf8_templates.h b/src/utf8/utf8_templates.h index 7acde96..20271a1 100644 --- a/src/utf8/utf8_templates.h +++ b/src/utf8/utf8_templates.h @@ -43,7 +43,7 @@ #include "utf8_private.h" -namespace PT +namespace pt { @@ -263,7 +263,7 @@ void WideStreamToUTF8(StreamTypeIn & buffer, StreamTypeOut & utf8, int mode) -} // namespace PT +} // namespace pt #endif diff --git a/tests/convert.cpp b/tests/convert.cpp index 7106d95..fbd4b3b 100644 --- a/tests/convert.cpp +++ b/tests/convert.cpp @@ -44,48 +44,45 @@ namespace pt { -// remove me in the future (when PT will be changed to pt) -using namespace PT; - - namespace pt_convert_tests { + void test_text1() { reset_test_counter("is_white"); - test(PT::is_white(0), false); - test(PT::is_white(1), false); - test(PT::is_white(9), true); - test(PT::is_white(10), true); - test(PT::is_white(30), false); - test(PT::is_white(32), true); - test(PT::is_white(40), false); - test(PT::is_white('a'), false); - test(PT::is_white(0xabcd), false); + test(pt::is_white(0), false); + test(pt::is_white(1), false); + test(pt::is_white(9), true); + test(pt::is_white(10), true); + test(pt::is_white(30), false); + test(pt::is_white(32), true); + test(pt::is_white(40), false); + test(pt::is_white('a'), false); + test(pt::is_white(0xabcd), false); - test(PT::is_white(5, false, false), false); - test(PT::is_white(9, false, false), true); - test(PT::is_white(10, false, false), false); - test(PT::is_white(31, false, false), false); - test(PT::is_white(32, false, false), true); - test(PT::is_white('z', false, false), false); - test(PT::is_white(0xbbcc, false, false), false); - test(PT::is_white(0xffff, false, false), false); - test(PT::is_white(0x10ffff, false, false), false); + test(pt::is_white(5, false, false), false); + test(pt::is_white(9, false, false), true); + test(pt::is_white(10, false, false), false); + test(pt::is_white(31, false, false), false); + test(pt::is_white(32, false, false), true); + test(pt::is_white('z', false, false), false); + test(pt::is_white(0xbbcc, false, false), false); + test(pt::is_white(0xffff, false, false), false); + test(pt::is_white(0x10ffff, false, false), false); - test(PT::is_white(0x000B, false, false), false); - test(PT::is_white(0x00A0, false, false), false); - test(PT::is_white(0x2001, false, false), false); - test(PT::is_white(0x2009, false, false), false); - test(PT::is_white(0xFEFF, false, false), false); + test(pt::is_white(0x000B, false, false), false); + test(pt::is_white(0x00A0, false, false), false); + test(pt::is_white(0x2001, false, false), false); + test(pt::is_white(0x2009, false, false), false); + test(pt::is_white(0xFEFF, false, false), false); - test(PT::is_white(0x000B, true, false), true); - test(PT::is_white(0x00A0, true, false), true); - test(PT::is_white(0x2001, true, false), true); - test(PT::is_white(0x2009, true, false), true); - test(PT::is_white(0xFEFF, true, false), true); + test(pt::is_white(0x000B, true, false), true); + test(pt::is_white(0x00A0, true, false), true); + test(pt::is_white(0x2001, true, false), true); + test(pt::is_white(0x2009, true, false), true); + test(pt::is_white(0xFEFF, true, false), true); } @@ -95,56 +92,56 @@ void test_text2() int digit; - test(PT::is_digit(0, 10, &digit), false); - test(PT::is_digit(1, 10, &digit), false); - test(PT::is_digit(10, 10, &digit), false); - test(PT::is_digit(32, 10, &digit), false); - test(PT::is_digit('z', 10, &digit), false); - test(PT::is_digit('x', 10, &digit), false); + test(pt::is_digit(0, 10, &digit), false); + test(pt::is_digit(1, 10, &digit), false); + test(pt::is_digit(10, 10, &digit), false); + test(pt::is_digit(32, 10, &digit), false); + test(pt::is_digit('z', 10, &digit), false); + test(pt::is_digit('x', 10, &digit), false); - test(PT::is_digit('0', 2, &digit), true); + test(pt::is_digit('0', 2, &digit), true); test(digit, 0); - test(PT::is_digit('1', 2, &digit), true); + test(pt::is_digit('1', 2, &digit), true); test(digit, 1); - test(PT::is_digit('2', 2, &digit), false); + test(pt::is_digit('2', 2, &digit), false); - test(PT::is_digit('0', 8, &digit), true); + test(pt::is_digit('0', 8, &digit), true); test(digit, 0); - test(PT::is_digit('7', 8, &digit), true); + test(pt::is_digit('7', 8, &digit), true); test(digit, 7); - test(PT::is_digit('8', 8, &digit), false); + test(pt::is_digit('8', 8, &digit), false); - test(PT::is_digit('0', 10, &digit), true); + test(pt::is_digit('0', 10, &digit), true); test(digit, 0); - test(PT::is_digit('1', 10, &digit), true); + test(pt::is_digit('1', 10, &digit), true); test(digit, 1); - test(PT::is_digit('8', 10, &digit), true); + test(pt::is_digit('8', 10, &digit), true); test(digit, 8); - test(PT::is_digit('9', 10, &digit), true); + test(pt::is_digit('9', 10, &digit), true); test(digit, 9); - test(PT::is_digit('a', 10, &digit), false); + test(pt::is_digit('a', 10, &digit), false); - test(PT::is_digit('a', 16, &digit), true); + test(pt::is_digit('a', 16, &digit), true); test(digit, 0x0a); - test(PT::is_digit('c', 16, &digit), true); + test(pt::is_digit('c', 16, &digit), true); test(digit, 0x0c); - test(PT::is_digit('f', 16, &digit), true); + test(pt::is_digit('f', 16, &digit), true); test(digit, 0x0f); - test(PT::is_digit('g', 16, &digit), false); + test(pt::is_digit('g', 16, &digit), false); } @@ -152,34 +149,34 @@ void test_text3() { reset_test_counter("skip_white"); - test(PT::skip_white(""), ""); - test(PT::skip_white(" "), ""); - test(PT::skip_white("\n \n"), ""); - test(PT::skip_white("hello world"), "hello world"); - test(PT::skip_white(" hello world"), "hello world"); - test(PT::skip_white(" hello world"), "hello world"); - test(PT::skip_white(" hello world"), "hello world"); - test(PT::skip_white(" hello world"), "hello world"); + test(pt::skip_white(""), ""); + test(pt::skip_white(" "), ""); + test(pt::skip_white("\n \n"), ""); + test(pt::skip_white("hello world"), "hello world"); + test(pt::skip_white(" hello world"), "hello world"); + test(pt::skip_white(" hello world"), "hello world"); + test(pt::skip_white(" hello world"), "hello world"); + test(pt::skip_white(" hello world"), "hello world"); - test(PT::skip_white("\n\nhello world"), "hello world"); - test(PT::skip_white("\n\nhello world", true, true), "hello world"); - test(PT::skip_white("\n\nhello world", true, false), "\n\nhello world"); - test(PT::skip_white("\n\n \n\n \t\t\n\nhello world", true, true), "hello world"); + test(pt::skip_white("\n\nhello world"), "hello world"); + test(pt::skip_white("\n\nhello world", true, true), "hello world"); + test(pt::skip_white("\n\nhello world", true, false), "\n\nhello world"); + test(pt::skip_white("\n\n \n\n \t\t\n\nhello world", true, true), "hello world"); - test(PT::skip_white(L" hello world"), L"hello world"); - test(PT::skip_white(L" hello world"), L"hello world"); - test(PT::skip_white(L" hello world"), L"hello world"); - test(PT::skip_white(L" hello world"), L"hello world"); + test(pt::skip_white(L" hello world"), L"hello world"); + test(pt::skip_white(L" hello world"), L"hello world"); + test(pt::skip_white(L" hello world"), L"hello world"); + test(pt::skip_white(L" hello world"), L"hello world"); - test(PT::skip_white(L"\n\nhello world", true, true), L"hello world"); - test(PT::skip_white(L"\n\nhello world", true, false), L"\n\nhello world"); - test(PT::skip_white(L"\n\n \n\n \t\t\n\nhello world", true, true), L"hello world"); + test(pt::skip_white(L"\n\nhello world", true, true), L"hello world"); + test(pt::skip_white(L"\n\nhello world", true, false), L"\n\nhello world"); + test(pt::skip_white(L"\n\n \n\n \t\t\n\nhello world", true, true), L"hello world"); - test(PT::skip_white(L"\x000B hello world", true, true), L"hello world"); - test(PT::skip_white(L"\x000B hello world", false, true), L"\x000B hello world"); + test(pt::skip_white(L"\x000B hello world", true, true), L"hello world"); + test(pt::skip_white(L"\x000B hello world", false, true), L"\x000B hello world"); - test(PT::skip_white(L"\x2029 hello world", true, true), L"hello world"); - test(PT::skip_white(L"\x2029 hello world", false, true), L"\x2029 hello world"); + test(pt::skip_white(L"\x2029 hello world", true, true), L"hello world"); + test(pt::skip_white(L"\x2029 hello world", false, true), L"\x2029 hello world"); } @@ -188,35 +185,35 @@ void test_text4() { reset_test_counter("skip_white_from_back"); - test(PT::skip_white_from_back(""), ""); - test(PT::skip_white_from_back(" "), " "); - test(PT::skip_white_from_back("\n \n"), "\n \n"); + test(pt::skip_white_from_back(""), ""); + test(pt::skip_white_from_back(" "), " "); + test(pt::skip_white_from_back("\n \n"), "\n \n"); - test(PT::skip_white_from_back("hello world"), ""); - test(PT::skip_white_from_back("hello world "), " "); - test(PT::skip_white_from_back("hello world "), " "); - test(PT::skip_white_from_back("hello world "), " "); + test(pt::skip_white_from_back("hello world"), ""); + test(pt::skip_white_from_back("hello world "), " "); + test(pt::skip_white_from_back("hello world "), " "); + test(pt::skip_white_from_back("hello world "), " "); - test(PT::skip_white_from_back("hello world\n\n"), "\n\n"); - test(PT::skip_white_from_back("hello world\n\n", true, true), "\n\n"); - test(PT::skip_white_from_back("hello world\n\n", true, false), ""); - test(PT::skip_white_from_back("hello world\n\n \n\n \t\t\n\n", true, true), "\n\n \n\n \t\t\n\n"); + test(pt::skip_white_from_back("hello world\n\n"), "\n\n"); + test(pt::skip_white_from_back("hello world\n\n", true, true), "\n\n"); + test(pt::skip_white_from_back("hello world\n\n", true, false), ""); + test(pt::skip_white_from_back("hello world\n\n \n\n \t\t\n\n", true, true), "\n\n \n\n \t\t\n\n"); - test(PT::skip_white_from_back(L"hello world "), L" "); - test(PT::skip_white_from_back(L"hello world "), L" "); - test(PT::skip_white_from_back(L"hello world\n\n\n\t\t\t "), L"\n\n\n\t\t\t "); - test(PT::skip_white_from_back(L"hello world "), L" "); + test(pt::skip_white_from_back(L"hello world "), L" "); + test(pt::skip_white_from_back(L"hello world "), L" "); + test(pt::skip_white_from_back(L"hello world\n\n\n\t\t\t "), L"\n\n\n\t\t\t "); + test(pt::skip_white_from_back(L"hello world "), L" "); - test(PT::skip_white_from_back(L"hello world\n\n", true, true), L"\n\n"); - test(PT::skip_white_from_back(L"hello world\n\n", true, false), L""); - test(PT::skip_white_from_back(L"hello world\n\n \n\n \t\t\n\n", true, true), L"\n\n \n\n \t\t\n\n"); + test(pt::skip_white_from_back(L"hello world\n\n", true, true), L"\n\n"); + test(pt::skip_white_from_back(L"hello world\n\n", true, false), L""); + test(pt::skip_white_from_back(L"hello world\n\n \n\n \t\t\n\n", true, true), L"\n\n \n\n \t\t\n\n"); - test(PT::skip_white_from_back(L"hello world \x000B", true, true), L" \x000B"); - test(PT::skip_white_from_back(L"hello world \x000B", false, true), L""); + test(pt::skip_white_from_back(L"hello world \x000B", true, true), L" \x000B"); + test(pt::skip_white_from_back(L"hello world \x000B", false, true), L""); - test(PT::skip_white_from_back(L"hello world \x2029", true, true), L" \x2029"); - test(PT::skip_white_from_back(L"hello world \x2029", false, true), L""); + test(pt::skip_white_from_back(L"hello world \x2029", true, true), L" \x2029"); + test(pt::skip_white_from_back(L"hello world \x2029", false, true), L""); } @@ -224,44 +221,44 @@ void test_text5() { reset_test_counter("to_lower"); - test(PT::to_lower((char)0), (char)0); - test(PT::to_lower((char)32), (char)32); - test(PT::to_lower((char)127), (char)127); - test(PT::to_lower((char)128), (char)128); - test(PT::to_lower((char)200), (char)200); - test(PT::to_lower((char)255), (char)255); + test(pt::to_lower((char)0), (char)0); + test(pt::to_lower((char)32), (char)32); + test(pt::to_lower((char)127), (char)127); + test(pt::to_lower((char)128), (char)128); + test(pt::to_lower((char)200), (char)200); + test(pt::to_lower((char)255), (char)255); - test(PT::to_lower('a'), 'a'); - test(PT::to_lower('c'), 'c'); - test(PT::to_lower('t'), 't'); - test(PT::to_lower('z'), 'z'); - test(PT::to_lower('0'), '0'); - test(PT::to_lower('A'), 'a'); - test(PT::to_lower('C'), 'c'); - test(PT::to_lower('X'), 'x'); - test(PT::to_lower('Z'), 'z'); - test(PT::to_lower('@'), '@'); - test(PT::to_lower('['), '['); - test(PT::to_lower('`'), '`'); - test(PT::to_lower('{'), '{'); + test(pt::to_lower('a'), 'a'); + test(pt::to_lower('c'), 'c'); + test(pt::to_lower('t'), 't'); + test(pt::to_lower('z'), 'z'); + test(pt::to_lower('0'), '0'); + test(pt::to_lower('A'), 'a'); + test(pt::to_lower('C'), 'c'); + test(pt::to_lower('X'), 'x'); + test(pt::to_lower('Z'), 'z'); + test(pt::to_lower('@'), '@'); + test(pt::to_lower('['), '['); + test(pt::to_lower('`'), '`'); + test(pt::to_lower('{'), '{'); - test(PT::to_lower((wchar_t)0), (wchar_t)0); - test(PT::to_lower((wchar_t)32), (wchar_t)32); - test(PT::to_lower((wchar_t)127), (wchar_t)127); - test(PT::to_lower((wchar_t)128), (wchar_t)128); - test(PT::to_lower((wchar_t)200), (wchar_t)200); - test(PT::to_lower((wchar_t)255), (wchar_t)255); + test(pt::to_lower((wchar_t)0), (wchar_t)0); + test(pt::to_lower((wchar_t)32), (wchar_t)32); + test(pt::to_lower((wchar_t)127), (wchar_t)127); + test(pt::to_lower((wchar_t)128), (wchar_t)128); + test(pt::to_lower((wchar_t)200), (wchar_t)200); + test(pt::to_lower((wchar_t)255), (wchar_t)255); - test(PT::to_lower(L'a'), L'a'); - test(PT::to_lower(L't'), L't'); - test(PT::to_lower(L'z'), L'z'); - test(PT::to_lower(L'0'), L'0'); - test(PT::to_lower(L'A'), L'a'); - test(PT::to_lower(L'C'), L'c'); - test(PT::to_lower(L'X'), L'x'); - test(PT::to_lower(L'Z'), L'z'); - test(PT::to_lower(L'@'), L'@'); - test(PT::to_lower(L'['), L'['); + test(pt::to_lower(L'a'), L'a'); + test(pt::to_lower(L't'), L't'); + test(pt::to_lower(L'z'), L'z'); + test(pt::to_lower(L'0'), L'0'); + test(pt::to_lower(L'A'), L'a'); + test(pt::to_lower(L'C'), L'c'); + test(pt::to_lower(L'X'), L'x'); + test(pt::to_lower(L'Z'), L'z'); + test(pt::to_lower(L'@'), L'@'); + test(pt::to_lower(L'['), L'['); } @@ -269,44 +266,44 @@ void test_text6() { reset_test_counter("to_upper"); - test(PT::to_upper((char)0), (char)0); - test(PT::to_upper((char)32), (char)32); - test(PT::to_upper((char)127), (char)127); - test(PT::to_upper((char)128), (char)128); - test(PT::to_upper((char)200), (char)200); - test(PT::to_upper((char)255), (char)255); + test(pt::to_upper((char)0), (char)0); + test(pt::to_upper((char)32), (char)32); + test(pt::to_upper((char)127), (char)127); + test(pt::to_upper((char)128), (char)128); + test(pt::to_upper((char)200), (char)200); + test(pt::to_upper((char)255), (char)255); - test(PT::to_upper('a'), 'A'); - test(PT::to_upper('c'), 'C'); - test(PT::to_upper('t'), 'T'); - test(PT::to_upper('z'), 'Z'); - test(PT::to_upper('0'), '0'); - test(PT::to_upper('A'), 'A'); - test(PT::to_upper('C'), 'C'); - test(PT::to_upper('X'), 'X'); - test(PT::to_upper('Z'), 'Z'); - test(PT::to_upper('@'), '@'); - test(PT::to_upper('['), '['); - test(PT::to_upper('`'), '`'); - test(PT::to_upper('{'), '{'); + test(pt::to_upper('a'), 'A'); + test(pt::to_upper('c'), 'C'); + test(pt::to_upper('t'), 'T'); + test(pt::to_upper('z'), 'Z'); + test(pt::to_upper('0'), '0'); + test(pt::to_upper('A'), 'A'); + test(pt::to_upper('C'), 'C'); + test(pt::to_upper('X'), 'X'); + test(pt::to_upper('Z'), 'Z'); + test(pt::to_upper('@'), '@'); + test(pt::to_upper('['), '['); + test(pt::to_upper('`'), '`'); + test(pt::to_upper('{'), '{'); - test(PT::to_upper((wchar_t)0), (wchar_t)0); - test(PT::to_upper((wchar_t)32), (wchar_t)32); - test(PT::to_upper((wchar_t)127), (wchar_t)127); - test(PT::to_upper((wchar_t)128), (wchar_t)128); - test(PT::to_upper((wchar_t)200), (wchar_t)200); - test(PT::to_upper((wchar_t)255), (wchar_t)255); + test(pt::to_upper((wchar_t)0), (wchar_t)0); + test(pt::to_upper((wchar_t)32), (wchar_t)32); + test(pt::to_upper((wchar_t)127), (wchar_t)127); + test(pt::to_upper((wchar_t)128), (wchar_t)128); + test(pt::to_upper((wchar_t)200), (wchar_t)200); + test(pt::to_upper((wchar_t)255), (wchar_t)255); - test(PT::to_upper(L'a'), L'A'); - test(PT::to_upper(L't'), L'T'); - test(PT::to_upper(L'z'), L'Z'); - test(PT::to_upper(L'0'), L'0'); - test(PT::to_upper(L'A'), L'A'); - test(PT::to_upper(L'C'), L'C'); - test(PT::to_upper(L'X'), L'X'); - test(PT::to_upper(L'Z'), L'Z'); - test(PT::to_upper(L'@'), L'@'); - test(PT::to_upper(L'['), L'['); + test(pt::to_upper(L'a'), L'A'); + test(pt::to_upper(L't'), L'T'); + test(pt::to_upper(L'z'), L'Z'); + test(pt::to_upper(L'0'), L'0'); + test(pt::to_upper(L'A'), L'A'); + test(pt::to_upper(L'C'), L'C'); + test(pt::to_upper(L'X'), L'X'); + test(pt::to_upper(L'Z'), L'Z'); + test(pt::to_upper(L'@'), L'@'); + test(pt::to_upper(L'['), L'['); } @@ -476,27 +473,27 @@ void test_text11() str1 = "abcdefghijklm nopqrstuvwxyz"; str2 = str1; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += "A"; str2 += "a"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += "B"; str2 += "b"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += "@[`{CDEFGHIJKLMNOPQRSTUVWXYZ"; str2 += "@[`{cdefghijklmnopqrstuvwxyz"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += "0123456789"; str2 += "0123456789"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += "[];'\\!@#$%^&*()_+"; str2 += "[];'\\!@#$%^&*()_+"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); } @@ -507,27 +504,27 @@ void test_text12() str1 = L"abcdefghijklm nopqrstuvwxyz"; str2 = str1; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += L"A"; str2 += L"a"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += L"B"; str2 += L"b"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += L"@[`{CDEFGHIJKLMNOPQRSTUVWXYZ"; str2 += L"@[`{cdefghijklmnopqrstuvwxyz"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += L"0123456789"; str2 += L"0123456789"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); str1 += L"[];'\\!@#$%^&*()_+"; str2 += L"[];'\\!@#$%^&*()_+"; - test(PT::to_lower(str1), str2); + test(pt::to_lower(str1), str2); } @@ -538,27 +535,27 @@ void test_text13() str1 = "ABCDEFGHIJKLM NOPQRSTUVWXYZ"; str2 = str1; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += "a"; str2 += "A"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += "b"; str2 += "B"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += "@[`{cdefghijklmnopqrstuvwxyz"; str2 += "@[`{CDEFGHIJKLMNOPQRSTUVWXYZ"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += "0123456789"; str2 += "0123456789"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += "[];'\\!@#$%^&*()_+"; str2 += "[];'\\!@#$%^&*()_+"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); } @@ -569,27 +566,27 @@ void test_text14() str1 = L"ABCDEFGHIJKLM NOPQRSTUVWXYZ"; str2 = str1; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += L"a"; str2 += L"A"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += L"b"; str2 += L"B"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += L"@[`{cdefghijklmnopqrstuvwxyz"; str2 += L"@[`{CDEFGHIJKLMNOPQRSTUVWXYZ"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += L"0123456789"; str2 += L"0123456789"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); str1 += L"[];'\\!@#$%^&*()_+"; str2 += L"[];'\\!@#$%^&*()_+"; - test(PT::to_upper(str1), str2); + test(pt::to_upper(str1), str2); } @@ -597,66 +594,66 @@ void test_text15() { reset_test_counter("compare const char *"); - test(PT::compare("", "") == 0, true); - test(PT::compare("a", "a") == 0, true); - test(PT::compare("abc", "abc") == 0, true); - test(PT::compare("ABC", "ABC") == 0, true); - test(PT::compare("hello world", "hello world") == 0, true); - test(PT::compare("hello world", "HELLO WORLD") > 0, true); - test(PT::compare("HELLO WORLD", "hello world") < 0, true); - test(PT::compare("HEllo WOrld", "heLLO woRLD") < 0, true); - test(PT::compare("heLLO woRLD", "HEllo WOrld") > 0, true); + test(pt::compare("", "") == 0, true); + test(pt::compare("a", "a") == 0, true); + test(pt::compare("abc", "abc") == 0, true); + test(pt::compare("ABC", "ABC") == 0, true); + test(pt::compare("hello world", "hello world") == 0, true); + test(pt::compare("hello world", "HELLO WORLD") > 0, true); + test(pt::compare("HELLO WORLD", "hello world") < 0, true); + test(pt::compare("HEllo WOrld", "heLLO woRLD") < 0, true); + test(pt::compare("heLLO woRLD", "HEllo WOrld") > 0, true); - test(PT::compare("a", "b") < 0, true); - test(PT::compare("b", "c") < 0, true); - test(PT::compare("x", "z") < 0, true); - test(PT::compare("hello world", "xhelloworld") < 0, true); + test(pt::compare("a", "b") < 0, true); + test(pt::compare("b", "c") < 0, true); + test(pt::compare("x", "z") < 0, true); + test(pt::compare("hello world", "xhelloworld") < 0, true); - test(PT::compare("c", "b") > 0, true); - test(PT::compare("d", "c") > 0, true); - test(PT::compare("z", "x") > 0, true); - test(PT::compare("xhello world", "helloworld") > 0, true); + test(pt::compare("c", "b") > 0, true); + test(pt::compare("d", "c") > 0, true); + test(pt::compare("z", "x") > 0, true); + test(pt::compare("xhello world", "helloworld") > 0, true); - test(PT::compare("abc8", "abc9") < 0, true); - test(PT::compare("abc9", "abc8") > 0, true); - test(PT::compare("abc8abc", "abc9abc") < 0, true); - test(PT::compare("abc9abc", "abc8abc") > 0, true); - test(PT::compare("abc9abc", "abc8") > 0, true); - test(PT::compare("abc8abc", "abc9") < 0, true); - test(PT::compare("abc8", "abc9abc") < 0, true); - test(PT::compare("abc9", "abc8abc") > 0, true); + test(pt::compare("abc8", "abc9") < 0, true); + test(pt::compare("abc9", "abc8") > 0, true); + test(pt::compare("abc8abc", "abc9abc") < 0, true); + test(pt::compare("abc9abc", "abc8abc") > 0, true); + test(pt::compare("abc9abc", "abc8") > 0, true); + test(pt::compare("abc8abc", "abc9") < 0, true); + test(pt::compare("abc8", "abc9abc") < 0, true); + test(pt::compare("abc9", "abc8abc") > 0, true); char foo[] = {"abc"}; char bar[] = {"abc"}; - test(PT::compare(foo, bar) == 0, true); + test(pt::compare(foo, bar) == 0, true); foo[0] = (char)(unsigned char)127; bar[0] = (char)(unsigned char)128; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (char)(unsigned char)128; bar[0] = (char)(unsigned char)127; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); foo[0] = (char)(unsigned char)1; bar[0] = (char)(unsigned char)255; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (char)(unsigned char)255; bar[0] = (char)(unsigned char)1; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); foo[0] = (char)(unsigned char)0; bar[0] = (char)(unsigned char)0; - test(PT::compare(foo, bar) == 0, true); + test(pt::compare(foo, bar) == 0, true); foo[0] = (char)(unsigned char)0; bar[0] = (char)(unsigned char)1; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (char)(unsigned char)1; bar[0] = (char)(unsigned char)0; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); } @@ -665,90 +662,90 @@ void test_text16() { reset_test_counter("compare const wchar_t *"); - test(PT::compare(L"", L"") == 0, true); - test(PT::compare(L"a", L"a") == 0, true); - test(PT::compare(L"abc", L"abc") == 0, true); - test(PT::compare(L"ABC", L"ABC") == 0, true); - test(PT::compare(L"hello world", L"hello world") == 0, true); - test(PT::compare(L"hello world", L"HELLO WORLD") > 0, true); - test(PT::compare(L"HELLO WORLD", L"hello world") < 0, true); - test(PT::compare(L"HEllo WOrld", L"heLLO woRLD") < 0, true); - test(PT::compare(L"heLLO woRLD", L"HEllo WOrld") > 0, true); + test(pt::compare(L"", L"") == 0, true); + test(pt::compare(L"a", L"a") == 0, true); + test(pt::compare(L"abc", L"abc") == 0, true); + test(pt::compare(L"ABC", L"ABC") == 0, true); + test(pt::compare(L"hello world", L"hello world") == 0, true); + test(pt::compare(L"hello world", L"HELLO WORLD") > 0, true); + test(pt::compare(L"HELLO WORLD", L"hello world") < 0, true); + test(pt::compare(L"HEllo WOrld", L"heLLO woRLD") < 0, true); + test(pt::compare(L"heLLO woRLD", L"HEllo WOrld") > 0, true); - test(PT::compare(L"a", L"b") < 0, true); - test(PT::compare(L"b", L"c") < 0, true); - test(PT::compare(L"x", L"z") < 0, true); - test(PT::compare(L"hello world", L"xhelloworld") < 0, true); + test(pt::compare(L"a", L"b") < 0, true); + test(pt::compare(L"b", L"c") < 0, true); + test(pt::compare(L"x", L"z") < 0, true); + test(pt::compare(L"hello world", L"xhelloworld") < 0, true); - test(PT::compare(L"c", L"b") > 0, true); - test(PT::compare(L"d", L"c") > 0, true); - test(PT::compare(L"z", L"x") > 0, true); - test(PT::compare(L"xhello world", L"helloworld") > 0, true); + test(pt::compare(L"c", L"b") > 0, true); + test(pt::compare(L"d", L"c") > 0, true); + test(pt::compare(L"z", L"x") > 0, true); + test(pt::compare(L"xhello world", L"helloworld") > 0, true); - test(PT::compare(L"abc8", L"abc9") < 0, true); - test(PT::compare(L"abc9", L"abc8") > 0, true); - test(PT::compare(L"abc8abc", L"abc9abc") < 0, true); - test(PT::compare(L"abc9abc", L"abc8abc") > 0, true); - test(PT::compare(L"abc9abc", L"abc8") > 0, true); - test(PT::compare(L"abc8abc", L"abc9") < 0, true); - test(PT::compare(L"abc8", L"abc9abc") < 0, true); - test(PT::compare(L"abc9", L"abc8abc") > 0, true); + test(pt::compare(L"abc8", L"abc9") < 0, true); + test(pt::compare(L"abc9", L"abc8") > 0, true); + test(pt::compare(L"abc8abc", L"abc9abc") < 0, true); + test(pt::compare(L"abc9abc", L"abc8abc") > 0, true); + test(pt::compare(L"abc9abc", L"abc8") > 0, true); + test(pt::compare(L"abc8abc", L"abc9") < 0, true); + test(pt::compare(L"abc8", L"abc9abc") < 0, true); + test(pt::compare(L"abc9", L"abc8abc") > 0, true); wchar_t foo[] = {L"abc"}; wchar_t bar[] = {L"abc"}; - test(PT::compare(foo, bar) == 0, true); + test(pt::compare(foo, bar) == 0, true); foo[0] = (wchar_t)127; bar[0] = (wchar_t)128; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (wchar_t)128; bar[0] = (wchar_t)127; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); foo[0] = (wchar_t)1; bar[0] = (wchar_t)255; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (wchar_t)255; bar[0] = (wchar_t)1; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); foo[0] = (wchar_t)0; bar[0] = (wchar_t)0; - test(PT::compare(foo, bar) == 0, true); + test(pt::compare(foo, bar) == 0, true); foo[0] = (wchar_t)0; bar[0] = (wchar_t)1; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (wchar_t)1; bar[0] = (wchar_t)0; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); foo[0] = (wchar_t)1; bar[0] = (wchar_t)0xffff; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (wchar_t)127; bar[0] = (wchar_t)0xffff; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (wchar_t)128; bar[0] = (wchar_t)0xffff; - test(PT::compare(foo, bar) < 0, true); + test(pt::compare(foo, bar) < 0, true); foo[0] = (wchar_t)0xffff; bar[0] = (wchar_t)1; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); foo[0] = (wchar_t)0xffff; bar[0] = (wchar_t)127; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); foo[0] = (wchar_t)0xffff; bar[0] = (wchar_t)128; - test(PT::compare(foo, bar) > 0, true); + test(pt::compare(foo, bar) > 0, true); } void test_text17() @@ -756,35 +753,35 @@ void test_text17() reset_test_counter("compare std::string"); std::string str1, str2; - test(PT::compare(str1, str2) == 0, true); + test(pt::compare(str1, str2) == 0, true); str1 = "abc"; str2 = "abc"; - test(PT::compare(str1, str2) == 0, true); + test(pt::compare(str1, str2) == 0, true); str1 = "aBc"; str2 = "abc"; - test(PT::compare(str1, str2) < 0, true); + test(pt::compare(str1, str2) < 0, true); str1 = "abc"; str2 = "aBc"; - test(PT::compare(str1, str2) > 0, true); + test(pt::compare(str1, str2) > 0, true); str1 = "xyz"; str2 = "abc"; - test(PT::compare(str1, str2) > 0, true); + test(pt::compare(str1, str2) > 0, true); str1 = "abc"; str2 = "xyz"; - test(PT::compare(str1, str2) < 0, true); + test(pt::compare(str1, str2) < 0, true); str1 = "abc1"; str2 = "abc2"; - test(PT::compare(str1, str2) < 0, true); + test(pt::compare(str1, str2) < 0, true); str1 = "abc9"; str2 = "abc8"; - test(PT::compare(str1, str2) > 0, true); + test(pt::compare(str1, str2) > 0, true); } void test_text18() @@ -792,35 +789,35 @@ void test_text18() reset_test_counter("compare std::wstring"); std::wstring str1, str2; - test(PT::compare(str1, str2) == 0, true); + test(pt::compare(str1, str2) == 0, true); str1 = L"abc"; str2 = L"abc"; - test(PT::compare(str1, str2) == 0, true); + test(pt::compare(str1, str2) == 0, true); str1 = L"aBc"; str2 = L"abc"; - test(PT::compare(str1, str2) < 0, true); + test(pt::compare(str1, str2) < 0, true); str1 = L"abc"; str2 = L"aBc"; - test(PT::compare(str1, str2) > 0, true); + test(pt::compare(str1, str2) > 0, true); str1 = L"xyz"; str2 = L"abc"; - test(PT::compare(str1, str2) > 0, true); + test(pt::compare(str1, str2) > 0, true); str1 = L"abc"; str2 = L"xyz"; - test(PT::compare(str1, str2) < 0, true); + test(pt::compare(str1, str2) < 0, true); str1 = L"abc1"; str2 = L"abc2"; - test(PT::compare(str1, str2) < 0, true); + test(pt::compare(str1, str2) < 0, true); str1 = L"abc9"; str2 = L"abc8"; - test(PT::compare(str1, str2) > 0, true); + test(pt::compare(str1, str2) > 0, true); } void test_text19() @@ -831,31 +828,31 @@ void test_text19() char bar[] = {"abcdef"}; size_t len = sizeof(foo) / sizeof(char) - 1; // minus terminating zero - test(PT::compare(foo, foo + len, bar) == 0, true); - test(PT::compare(foo, foo + len - 1, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) == 0, true); + test(pt::compare(foo, foo + len - 1, bar) < 0, true); foo[len - 1] = (char)(unsigned char)127; bar[len - 1] = (char)(unsigned char)128; - test(PT::compare(foo, foo + len, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) < 0, true); foo[len - 1] = (char)(unsigned char)128; bar[len - 1] = (char)(unsigned char)127; - test(PT::compare(foo, foo + len, bar) > 0, true); + test(pt::compare(foo, foo + len, bar) > 0, true); foo[len - 1] = (char)(unsigned char)1; bar[len - 1] = (char)(unsigned char)255; - test(PT::compare(foo, foo + len, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) < 0, true); foo[len - 1] = (char)(unsigned char)255; bar[len - 1] = (char)(unsigned char)1; - test(PT::compare(foo, foo + len, bar) > 0, true); + test(pt::compare(foo, foo + len, bar) > 0, true); foo[len - 1] = 'f'; bar[len - 1] = 'f'; bar[3] = 'X'; - test(PT::compare(foo, foo + len, bar) > 0, true); + test(pt::compare(foo, foo + len, bar) > 0, true); foo[3] = 'A'; - test(PT::compare(foo, foo + len, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) < 0, true); } void test_text20() @@ -866,39 +863,39 @@ void test_text20() wchar_t bar[] = {L"abcdef"}; size_t len = sizeof(foo) / sizeof(wchar_t) - 1; // minus terminating zero - test(PT::compare(foo, foo + len, bar) == 0, true); - test(PT::compare(foo, foo + len - 1, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) == 0, true); + test(pt::compare(foo, foo + len - 1, bar) < 0, true); foo[len - 1] = (wchar_t)127; bar[len - 1] = (wchar_t)128; - test(PT::compare(foo, foo + len, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) < 0, true); foo[len - 1] = (wchar_t)128; bar[len - 1] = (wchar_t)127; - test(PT::compare(foo, foo + len, bar) > 0, true); + test(pt::compare(foo, foo + len, bar) > 0, true); foo[len - 1] = (wchar_t)1; bar[len - 1] = (wchar_t)255; - test(PT::compare(foo, foo + len, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) < 0, true); foo[len - 1] = (wchar_t)255; bar[len - 1] = (wchar_t)1; - test(PT::compare(foo, foo + len, bar) > 0, true); + test(pt::compare(foo, foo + len, bar) > 0, true); foo[len - 1] = (wchar_t)1; bar[len - 1] = (wchar_t)0xffff; - test(PT::compare(foo, foo + len, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) < 0, true); foo[len - 1] = (wchar_t)0xffff; bar[len - 1] = (wchar_t)1; - test(PT::compare(foo, foo + len, bar) > 0, true); + test(pt::compare(foo, foo + len, bar) > 0, true); foo[len - 1] = L'f'; bar[len - 1] = L'f'; bar[3] = L'X'; - test(PT::compare(foo, foo + len, bar) > 0, true); + test(pt::compare(foo, foo + len, bar) > 0, true); foo[3] = L'A'; - test(PT::compare(foo, foo + len, bar) < 0, true); + test(pt::compare(foo, foo + len, bar) < 0, true); } @@ -907,66 +904,66 @@ void test_text21() { reset_test_counter("compare_nc const char *"); - test(PT::compare_nc("", "") == 0, true); - test(PT::compare_nc("a", "a") == 0, true); - test(PT::compare_nc("abc", "abc") == 0, true); - test(PT::compare_nc("ABC", "ABC") == 0, true); - test(PT::compare_nc("hello world", "hello world") == 0, true); - test(PT::compare_nc("hello world", "HELLO WORLD") == 0, true); - test(PT::compare_nc("HELLO WORLD", "hello world") == 0, true); - test(PT::compare_nc("HEllo WOrld", "heLLO woRLD") == 0, true); - test(PT::compare_nc("heLLO woRLD", "HEllo WOrld")== 0, true); + test(pt::compare_nc("", "") == 0, true); + test(pt::compare_nc("a", "a") == 0, true); + test(pt::compare_nc("abc", "abc") == 0, true); + test(pt::compare_nc("ABC", "ABC") == 0, true); + test(pt::compare_nc("hello world", "hello world") == 0, true); + test(pt::compare_nc("hello world", "HELLO WORLD") == 0, true); + test(pt::compare_nc("HELLO WORLD", "hello world") == 0, true); + test(pt::compare_nc("HEllo WOrld", "heLLO woRLD") == 0, true); + test(pt::compare_nc("heLLO woRLD", "HEllo WOrld")== 0, true); - test(PT::compare_nc("a", "b") < 0, true); - test(PT::compare_nc("b", "c") < 0, true); - test(PT::compare_nc("x", "z") < 0, true); - test(PT::compare_nc("hello world", "xhelloworld") < 0, true); + test(pt::compare_nc("a", "b") < 0, true); + test(pt::compare_nc("b", "c") < 0, true); + test(pt::compare_nc("x", "z") < 0, true); + test(pt::compare_nc("hello world", "xhelloworld") < 0, true); - test(PT::compare_nc("c", "b") > 0, true); - test(PT::compare_nc("d", "c") > 0, true); - test(PT::compare_nc("z", "x") > 0, true); - test(PT::compare_nc("xhello world", "helloworld") > 0, true); + test(pt::compare_nc("c", "b") > 0, true); + test(pt::compare_nc("d", "c") > 0, true); + test(pt::compare_nc("z", "x") > 0, true); + test(pt::compare_nc("xhello world", "helloworld") > 0, true); - test(PT::compare_nc("abc8", "abc9") < 0, true); - test(PT::compare_nc("abc9", "abc8") > 0, true); - test(PT::compare_nc("abc8abc", "abc9abc") < 0, true); - test(PT::compare_nc("abc9abc", "abc8abc") > 0, true); - test(PT::compare_nc("abc9abc", "abc8") > 0, true); - test(PT::compare_nc("abc8abc", "abc9") < 0, true); - test(PT::compare_nc("abc8", "abc9abc") < 0, true); - test(PT::compare_nc("abc9", "abc8abc") > 0, true); + test(pt::compare_nc("abc8", "abc9") < 0, true); + test(pt::compare_nc("abc9", "abc8") > 0, true); + test(pt::compare_nc("abc8abc", "abc9abc") < 0, true); + test(pt::compare_nc("abc9abc", "abc8abc") > 0, true); + test(pt::compare_nc("abc9abc", "abc8") > 0, true); + test(pt::compare_nc("abc8abc", "abc9") < 0, true); + test(pt::compare_nc("abc8", "abc9abc") < 0, true); + test(pt::compare_nc("abc9", "abc8abc") > 0, true); char foo[] = {"abc"}; char bar[] = {"abc"}; - test(PT::compare_nc(foo, bar) == 0, true); + test(pt::compare_nc(foo, bar) == 0, true); foo[0] = (char)(unsigned char)127; bar[0] = (char)(unsigned char)128; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (char)(unsigned char)128; bar[0] = (char)(unsigned char)127; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); foo[0] = (char)(unsigned char)1; bar[0] = (char)(unsigned char)255; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (char)(unsigned char)255; bar[0] = (char)(unsigned char)1; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); foo[0] = (char)(unsigned char)0; bar[0] = (char)(unsigned char)0; - test(PT::compare_nc(foo, bar) == 0, true); + test(pt::compare_nc(foo, bar) == 0, true); foo[0] = (char)(unsigned char)0; bar[0] = (char)(unsigned char)1; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (char)(unsigned char)1; bar[0] = (char)(unsigned char)0; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); } @@ -975,90 +972,90 @@ void test_text22() { reset_test_counter("compare_nc const wchar_t *"); - test(PT::compare_nc(L"", L"") == 0, true); - test(PT::compare_nc(L"a", L"a") == 0, true); - test(PT::compare_nc(L"abc", L"abc") == 0, true); - test(PT::compare_nc(L"ABC", L"ABC") == 0, true); - test(PT::compare_nc(L"hello world", L"hello world") == 0, true); - test(PT::compare_nc(L"hello world", L"HELLO WORLD") == 0, true); - test(PT::compare_nc(L"HELLO WORLD", L"hello world") == 0, true); - test(PT::compare_nc(L"HEllo WOrld", L"heLLO woRLD") == 0, true); - test(PT::compare_nc(L"heLLO woRLD", L"HEllo WOrld") == 0, true); + test(pt::compare_nc(L"", L"") == 0, true); + test(pt::compare_nc(L"a", L"a") == 0, true); + test(pt::compare_nc(L"abc", L"abc") == 0, true); + test(pt::compare_nc(L"ABC", L"ABC") == 0, true); + test(pt::compare_nc(L"hello world", L"hello world") == 0, true); + test(pt::compare_nc(L"hello world", L"HELLO WORLD") == 0, true); + test(pt::compare_nc(L"HELLO WORLD", L"hello world") == 0, true); + test(pt::compare_nc(L"HEllo WOrld", L"heLLO woRLD") == 0, true); + test(pt::compare_nc(L"heLLO woRLD", L"HEllo WOrld") == 0, true); - test(PT::compare_nc(L"a", L"b") < 0, true); - test(PT::compare_nc(L"b", L"c") < 0, true); - test(PT::compare_nc(L"x", L"z") < 0, true); - test(PT::compare_nc(L"hello world", L"xhelloworld") < 0, true); + test(pt::compare_nc(L"a", L"b") < 0, true); + test(pt::compare_nc(L"b", L"c") < 0, true); + test(pt::compare_nc(L"x", L"z") < 0, true); + test(pt::compare_nc(L"hello world", L"xhelloworld") < 0, true); - test(PT::compare_nc(L"c", L"b") > 0, true); - test(PT::compare_nc(L"d", L"c") > 0, true); - test(PT::compare_nc(L"z", L"x") > 0, true); - test(PT::compare_nc(L"xhello world", L"helloworld") > 0, true); + test(pt::compare_nc(L"c", L"b") > 0, true); + test(pt::compare_nc(L"d", L"c") > 0, true); + test(pt::compare_nc(L"z", L"x") > 0, true); + test(pt::compare_nc(L"xhello world", L"helloworld") > 0, true); - test(PT::compare_nc(L"abc8", L"abc9") < 0, true); - test(PT::compare_nc(L"abc9", L"abc8") > 0, true); - test(PT::compare_nc(L"abc8abc", L"abc9abc") < 0, true); - test(PT::compare_nc(L"abc9abc", L"abc8abc") > 0, true); - test(PT::compare_nc(L"abc9abc", L"abc8") > 0, true); - test(PT::compare_nc(L"abc8abc", L"abc9") < 0, true); - test(PT::compare_nc(L"abc8", L"abc9abc") < 0, true); - test(PT::compare_nc(L"abc9", L"abc8abc") > 0, true); + test(pt::compare_nc(L"abc8", L"abc9") < 0, true); + test(pt::compare_nc(L"abc9", L"abc8") > 0, true); + test(pt::compare_nc(L"abc8abc", L"abc9abc") < 0, true); + test(pt::compare_nc(L"abc9abc", L"abc8abc") > 0, true); + test(pt::compare_nc(L"abc9abc", L"abc8") > 0, true); + test(pt::compare_nc(L"abc8abc", L"abc9") < 0, true); + test(pt::compare_nc(L"abc8", L"abc9abc") < 0, true); + test(pt::compare_nc(L"abc9", L"abc8abc") > 0, true); wchar_t foo[] = {L"abc"}; wchar_t bar[] = {L"abc"}; - test(PT::compare_nc(foo, bar) == 0, true); + test(pt::compare_nc(foo, bar) == 0, true); foo[0] = (wchar_t)127; bar[0] = (wchar_t)128; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (wchar_t)128; bar[0] = (wchar_t)127; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); foo[0] = (wchar_t)1; bar[0] = (wchar_t)255; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (wchar_t)255; bar[0] = (wchar_t)1; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); foo[0] = (wchar_t)0; bar[0] = (wchar_t)0; - test(PT::compare_nc(foo, bar) == 0, true); + test(pt::compare_nc(foo, bar) == 0, true); foo[0] = (wchar_t)0; bar[0] = (wchar_t)1; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (wchar_t)1; bar[0] = (wchar_t)0; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); foo[0] = (wchar_t)1; bar[0] = (wchar_t)0xffff; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (wchar_t)127; bar[0] = (wchar_t)0xffff; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (wchar_t)128; bar[0] = (wchar_t)0xffff; - test(PT::compare_nc(foo, bar) < 0, true); + test(pt::compare_nc(foo, bar) < 0, true); foo[0] = (wchar_t)0xffff; bar[0] = (wchar_t)1; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); foo[0] = (wchar_t)0xffff; bar[0] = (wchar_t)127; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); foo[0] = (wchar_t)0xffff; bar[0] = (wchar_t)128; - test(PT::compare_nc(foo, bar) > 0, true); + test(pt::compare_nc(foo, bar) > 0, true); } void test_text23() @@ -1066,35 +1063,35 @@ void test_text23() reset_test_counter("compare_nc std::string"); std::string str1, str2; - test(PT::compare_nc(str1, str2) == 0, true); + test(pt::compare_nc(str1, str2) == 0, true); str1 = "abc"; str2 = "abc"; - test(PT::compare_nc(str1, str2) == 0, true); + test(pt::compare_nc(str1, str2) == 0, true); str1 = "aBc"; str2 = "abc"; - test(PT::compare_nc(str1, str2) == 0, true); + test(pt::compare_nc(str1, str2) == 0, true); str1 = "abc"; str2 = "aBc"; - test(PT::compare_nc(str1, str2) == 0, true); + test(pt::compare_nc(str1, str2) == 0, true); str1 = "xyz"; str2 = "abc"; - test(PT::compare_nc(str1, str2) > 0, true); + test(pt::compare_nc(str1, str2) > 0, true); str1 = "abc"; str2 = "xyz"; - test(PT::compare_nc(str1, str2) < 0, true); + test(pt::compare_nc(str1, str2) < 0, true); str1 = "abc1"; str2 = "abc2"; - test(PT::compare_nc(str1, str2) < 0, true); + test(pt::compare_nc(str1, str2) < 0, true); str1 = "abc9"; str2 = "abc8"; - test(PT::compare_nc(str1, str2) > 0, true); + test(pt::compare_nc(str1, str2) > 0, true); } void test_text24() @@ -1102,35 +1099,35 @@ void test_text24() reset_test_counter("compare_nc std::wstring"); std::wstring str1, str2; - test(PT::compare_nc(str1, str2) == 0, true); + test(pt::compare_nc(str1, str2) == 0, true); str1 = L"abc"; str2 = L"abc"; - test(PT::compare_nc(str1, str2) == 0, true); + test(pt::compare_nc(str1, str2) == 0, true); str1 = L"aBc"; str2 = L"abc"; - test(PT::compare_nc(str1, str2) == 0, true); + test(pt::compare_nc(str1, str2) == 0, true); str1 = L"abc"; str2 = L"aBc"; - test(PT::compare_nc(str1, str2) == 0, true); + test(pt::compare_nc(str1, str2) == 0, true); str1 = L"xyz"; str2 = L"abc"; - test(PT::compare_nc(str1, str2) > 0, true); + test(pt::compare_nc(str1, str2) > 0, true); str1 = L"abc"; str2 = L"xyz"; - test(PT::compare_nc(str1, str2) < 0, true); + test(pt::compare_nc(str1, str2) < 0, true); str1 = L"abc1"; str2 = L"abc2"; - test(PT::compare_nc(str1, str2) < 0, true); + test(pt::compare_nc(str1, str2) < 0, true); str1 = L"abc9"; str2 = L"abc8"; - test(PT::compare_nc(str1, str2) > 0, true); + test(pt::compare_nc(str1, str2) > 0, true); } void test_text25() @@ -1141,31 +1138,31 @@ void test_text25() char bar[] = {"abcdef"}; size_t len = sizeof(foo) / sizeof(char) - 1; // minus terminating zero - test(PT::compare_nc(foo, foo + len, bar) == 0, true); - test(PT::compare_nc(foo, foo + len - 1, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) == 0, true); + test(pt::compare_nc(foo, foo + len - 1, bar) < 0, true); foo[len - 1] = (char)(unsigned char)127; bar[len - 1] = (char)(unsigned char)128; - test(PT::compare_nc(foo, foo + len, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) < 0, true); foo[len - 1] = (char)(unsigned char)128; bar[len - 1] = (char)(unsigned char)127; - test(PT::compare_nc(foo, foo + len, bar) > 0, true); + test(pt::compare_nc(foo, foo + len, bar) > 0, true); foo[len - 1] = (char)(unsigned char)1; bar[len - 1] = (char)(unsigned char)255; - test(PT::compare_nc(foo, foo + len, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) < 0, true); foo[len - 1] = (char)(unsigned char)255; bar[len - 1] = (char)(unsigned char)1; - test(PT::compare_nc(foo, foo + len, bar) > 0, true); + test(pt::compare_nc(foo, foo + len, bar) > 0, true); foo[len - 1] = 'f'; bar[len - 1] = 'f'; bar[3] = 'X'; - test(PT::compare_nc(foo, foo + len, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) < 0, true); foo[3] = 'Z'; - test(PT::compare_nc(foo, foo + len, bar) > 0, true); + test(pt::compare_nc(foo, foo + len, bar) > 0, true); } void test_text26() @@ -1176,39 +1173,39 @@ void test_text26() wchar_t bar[] = {L"abcdef"}; size_t len = sizeof(foo) / sizeof(wchar_t) - 1; // minus terminating zero - test(PT::compare_nc(foo, foo + len, bar) == 0, true); - test(PT::compare_nc(foo, foo + len - 1, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) == 0, true); + test(pt::compare_nc(foo, foo + len - 1, bar) < 0, true); foo[len - 1] = (wchar_t)127; bar[len - 1] = (wchar_t)128; - test(PT::compare_nc(foo, foo + len, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) < 0, true); foo[len - 1] = (wchar_t)128; bar[len - 1] = (wchar_t)127; - test(PT::compare_nc(foo, foo + len, bar) > 0, true); + test(pt::compare_nc(foo, foo + len, bar) > 0, true); foo[len - 1] = (wchar_t)1; bar[len - 1] = (wchar_t)255; - test(PT::compare_nc(foo, foo + len, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) < 0, true); foo[len - 1] = (wchar_t)255; bar[len - 1] = (wchar_t)1; - test(PT::compare_nc(foo, foo + len, bar) > 0, true); + test(pt::compare_nc(foo, foo + len, bar) > 0, true); foo[len - 1] = (wchar_t)1; bar[len - 1] = (wchar_t)0xffff; - test(PT::compare_nc(foo, foo + len, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) < 0, true); foo[len - 1] = (wchar_t)0xffff; bar[len - 1] = (wchar_t)1; - test(PT::compare_nc(foo, foo + len, bar) > 0, true); + test(pt::compare_nc(foo, foo + len, bar) > 0, true); foo[len - 1] = L'f'; bar[len - 1] = L'f'; bar[3] = L'X'; - test(PT::compare_nc(foo, foo + len, bar) < 0, true); + test(pt::compare_nc(foo, foo + len, bar) < 0, true); foo[3] = L'Z'; - test(PT::compare_nc(foo, foo + len, bar) > 0, true); + test(pt::compare_nc(foo, foo + len, bar) > 0, true); } @@ -1338,35 +1335,35 @@ void test_text31() char bar[] = {"ABCDEF"}; size_t len = sizeof(foo) / sizeof(char) - 1; // minus terminating zero - test(PT::is_equal(foo, foo + len, bar), true); - test(PT::is_equal(foo, foo + len - 1, bar), false); + test(pt::is_equal(foo, foo + len, bar), true); + test(pt::is_equal(foo, foo + len - 1, bar), false); foo[len - 1] = (char)(unsigned char)127; bar[len - 1] = (char)(unsigned char)128; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[len - 1] = (char)(unsigned char)128; bar[len - 1] = (char)(unsigned char)127; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[len - 1] = (char)(unsigned char)1; bar[len - 1] = (char)(unsigned char)255; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[len - 1] = (char)(unsigned char)255; bar[len - 1] = (char)(unsigned char)1; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[len - 1] = 'f'; bar[len - 1] = 'f'; bar[3] = 'X'; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[3] = 'A'; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[3] = '1'; bar[3] = '1'; - test(PT::is_equal(foo, foo + len, bar), true); + test(pt::is_equal(foo, foo + len, bar), true); } @@ -1378,35 +1375,35 @@ void test_text32() wchar_t bar[] = {L"ABCDEF"}; size_t len = sizeof(foo) / sizeof(wchar_t) - 1; // minus terminating zero - test(PT::is_equal(foo, foo + len, bar), true); - test(PT::is_equal(foo, foo + len - 1, bar), false); + test(pt::is_equal(foo, foo + len, bar), true); + test(pt::is_equal(foo, foo + len - 1, bar), false); foo[len - 1] = (wchar_t)127; bar[len - 1] = (wchar_t)128; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[len - 1] = (wchar_t)128; bar[len - 1] = (wchar_t)127; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[len - 1] = (wchar_t)1; bar[len - 1] = (wchar_t)255; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[len - 1] = (wchar_t)255; bar[len - 1] = (wchar_t)1; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[len - 1] = L'f'; bar[len - 1] = L'f'; bar[3] = L'X'; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[3] = L'A'; - test(PT::is_equal(foo, foo + len, bar), false); + test(pt::is_equal(foo, foo + len, bar), false); foo[3] = L'1'; bar[3] = L'1'; - test(PT::is_equal(foo, foo + len, bar), true); + test(pt::is_equal(foo, foo + len, bar), true); } @@ -1537,43 +1534,43 @@ void test_text37() char bar[] = {"ABCDEF"}; size_t len = sizeof(foo) / sizeof(char) - 1; // minus terminating zero - test(PT::is_equal_nc(foo, foo + len, bar), true); - test(PT::is_equal_nc(foo, foo + len - 1, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), true); + test(pt::is_equal_nc(foo, foo + len - 1, bar), false); foo[len - 1] = (char)(unsigned char)127; bar[len - 1] = (char)(unsigned char)128; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[len - 1] = (char)(unsigned char)128; bar[len - 1] = (char)(unsigned char)127; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[len - 1] = (char)(unsigned char)1; bar[len - 1] = (char)(unsigned char)255; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[len - 1] = (char)(unsigned char)255; bar[len - 1] = (char)(unsigned char)1; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[len - 1] = 'f'; bar[len - 1] = 'f'; bar[3] = 'X'; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[3] = 'A'; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[3] = '1'; bar[3] = '1'; - test(PT::is_equal_nc(foo, foo + len, bar), true); + test(pt::is_equal_nc(foo, foo + len, bar), true); foo[3] = 'h'; bar[3] = 'H'; - test(PT::is_equal_nc(foo, foo + len, bar), true); + test(pt::is_equal_nc(foo, foo + len, bar), true); foo[3] = 'H'; bar[3] = 'h'; - test(PT::is_equal_nc(foo, foo + len, bar), true); + test(pt::is_equal_nc(foo, foo + len, bar), true); } @@ -1585,43 +1582,43 @@ void test_text38() wchar_t bar[] = {L"ABCDEF"}; size_t len = sizeof(foo) / sizeof(wchar_t) - 1; // minus terminating zero - test(PT::is_equal_nc(foo, foo + len, bar), true); - test(PT::is_equal_nc(foo, foo + len - 1, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), true); + test(pt::is_equal_nc(foo, foo + len - 1, bar), false); foo[len - 1] = (wchar_t)127; bar[len - 1] = (wchar_t)128; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[len - 1] = (wchar_t)128; bar[len - 1] = (wchar_t)127; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[len - 1] = (wchar_t)1; bar[len - 1] = (wchar_t)255; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[len - 1] = (wchar_t)255; bar[len - 1] = (wchar_t)1; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[len - 1] = L'f'; bar[len - 1] = L'f'; bar[3] = L'X'; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[3] = L'A'; - test(PT::is_equal_nc(foo, foo + len, bar), false); + test(pt::is_equal_nc(foo, foo + len, bar), false); foo[3] = L'1'; bar[3] = L'1'; - test(PT::is_equal_nc(foo, foo + len, bar), true); + test(pt::is_equal_nc(foo, foo + len, bar), true); foo[3] = L'h'; bar[3] = L'H'; - test(PT::is_equal_nc(foo, foo + len, bar), true); + test(pt::is_equal_nc(foo, foo + len, bar), true); foo[3] = L'H'; bar[3] = L'h'; - test(PT::is_equal_nc(foo, foo + len, bar), true); + test(pt::is_equal_nc(foo, foo + len, bar), true); } @@ -1629,20 +1626,20 @@ void test_text39() { reset_test_counter("is_substr const char *"); - test(PT::is_substr("", ""), true); - test(PT::is_substr("", "a"), true); - test(PT::is_substr("a", ""), false); - test(PT::is_substr("a", "a"), true); - test(PT::is_substr("a", "ab"), true); - test(PT::is_substr("abc", "abb"), false); - test(PT::is_substr("abc", "abcd"), true); - test(PT::is_substr("XYZ", "XYZabc"), true); - test(PT::is_substr("XYZ", "xYz"), false); - test(PT::is_substr("hello world", "hello world"), true); - test(PT::is_substr("hello world", "abc hello world"), false); - test(PT::is_substr("hello world", "hello worldabc"), true); - test(PT::is_substr("Hello World", "hello world"), false); - test(PT::is_substr("hello world", "Hello World"), false); + test(pt::is_substr("", ""), true); + test(pt::is_substr("", "a"), true); + test(pt::is_substr("a", ""), false); + test(pt::is_substr("a", "a"), true); + test(pt::is_substr("a", "ab"), true); + test(pt::is_substr("abc", "abb"), false); + test(pt::is_substr("abc", "abcd"), true); + test(pt::is_substr("XYZ", "XYZabc"), true); + test(pt::is_substr("XYZ", "xYz"), false); + test(pt::is_substr("hello world", "hello world"), true); + test(pt::is_substr("hello world", "abc hello world"), false); + test(pt::is_substr("hello world", "hello worldabc"), true); + test(pt::is_substr("Hello World", "hello world"), false); + test(pt::is_substr("hello world", "Hello World"), false); } @@ -1650,20 +1647,20 @@ void test_text40() { reset_test_counter("is_substr const wchar_t *"); - test(PT::is_substr(L"", L""), true); - test(PT::is_substr(L"", L"a"), true); - test(PT::is_substr(L"a", L""), false); - test(PT::is_substr(L"a", L"a"), true); - test(PT::is_substr(L"a", L"ab"), true); - test(PT::is_substr(L"abc", L"abb"), false); - test(PT::is_substr(L"abc", L"abcd"), true); - test(PT::is_substr(L"XYZ", L"XYZabc"), true); - test(PT::is_substr(L"XYZ", L"xYz"), false); - test(PT::is_substr(L"hello world", L"hello world"), true); - test(PT::is_substr(L"hello world", L"abc hello world"), false); - test(PT::is_substr(L"hello world", L"hello worldabc"), true); - test(PT::is_substr(L"Hello World", L"hello world"), false); - test(PT::is_substr(L"hello world", L"Hello World"), false); + test(pt::is_substr(L"", L""), true); + test(pt::is_substr(L"", L"a"), true); + test(pt::is_substr(L"a", L""), false); + test(pt::is_substr(L"a", L"a"), true); + test(pt::is_substr(L"a", L"ab"), true); + test(pt::is_substr(L"abc", L"abb"), false); + test(pt::is_substr(L"abc", L"abcd"), true); + test(pt::is_substr(L"XYZ", L"XYZabc"), true); + test(pt::is_substr(L"XYZ", L"xYz"), false); + test(pt::is_substr(L"hello world", L"hello world"), true); + test(pt::is_substr(L"hello world", L"abc hello world"), false); + test(pt::is_substr(L"hello world", L"hello worldabc"), true); + test(pt::is_substr(L"Hello World", L"hello world"), false); + test(pt::is_substr(L"hello world", L"Hello World"), false); } @@ -1673,51 +1670,51 @@ void test_text41() reset_test_counter("is_substr std::string"); std::string str1, str2; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = ""; str2 = "a"; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = "a"; str2 = "a"; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = "a"; str2 = ""; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = "abcd"; str2 = "abcd"; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = "abcdefg"; str2 = "abcd"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = "abcd"; str2 = "abcdefg"; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = "aBCd"; str2 = "abcd"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = "abcd"; str2 = "aBCd"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = "aBCdefg"; str2 = "abcd"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = "aBCd"; str2 = "abcdefg"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = "abcd"; str2 = "aBCdefg"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); } @@ -1726,51 +1723,51 @@ void test_text42() reset_test_counter("is_substr std::wstring"); std::wstring str1, str2; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = L""; str2 = L"a"; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = L"a"; str2 = L"a"; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = L"a"; str2 = L""; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = L"abcd"; str2 = L"abcd"; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = L"abcdefg"; str2 = L"abcd"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = L"abcd"; str2 = L"abcdefg"; - test(PT::is_substr(str1, str2), true); + test(pt::is_substr(str1, str2), true); str1 = L"aBCd"; str2 = L"abcd"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = L"abcd"; str2 = L"aBCd"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = L"aBCdefg"; str2 = L"abcd"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = L"aBCd"; str2 = L"abcdefg"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); str1 = L"abcd"; str2 = L"aBCdefg"; - test(PT::is_substr(str1, str2), false); + test(pt::is_substr(str1, str2), false); } @@ -1779,20 +1776,20 @@ void test_text43() { reset_test_counter("is_substr_nc const char *"); - test(PT::is_substr_nc("", ""), true); - test(PT::is_substr_nc("", "a"), true); - test(PT::is_substr_nc("a", ""), false); - test(PT::is_substr_nc("a", "a"), true); - test(PT::is_substr_nc("a", "ab"), true); - test(PT::is_substr_nc("abc", "abb"), false); - test(PT::is_substr_nc("abc", "abcd"), true); - test(PT::is_substr_nc("XYZ", "XYZabc"), true); - test(PT::is_substr_nc("XYZ", "xYz"), true); - test(PT::is_substr_nc("hello world", "hello world"), true); - test(PT::is_substr_nc("hello world", "abc hello world"), false); - test(PT::is_substr_nc("hello world", "hello worldabc"), true); - test(PT::is_substr_nc("Hello World", "hello world"), true); - test(PT::is_substr_nc("hello world", "Hello World"), true); + test(pt::is_substr_nc("", ""), true); + test(pt::is_substr_nc("", "a"), true); + test(pt::is_substr_nc("a", ""), false); + test(pt::is_substr_nc("a", "a"), true); + test(pt::is_substr_nc("a", "ab"), true); + test(pt::is_substr_nc("abc", "abb"), false); + test(pt::is_substr_nc("abc", "abcd"), true); + test(pt::is_substr_nc("XYZ", "XYZabc"), true); + test(pt::is_substr_nc("XYZ", "xYz"), true); + test(pt::is_substr_nc("hello world", "hello world"), true); + test(pt::is_substr_nc("hello world", "abc hello world"), false); + test(pt::is_substr_nc("hello world", "hello worldabc"), true); + test(pt::is_substr_nc("Hello World", "hello world"), true); + test(pt::is_substr_nc("hello world", "Hello World"), true); } @@ -1800,20 +1797,20 @@ void test_text44() { reset_test_counter("is_substr_nc const wchar_t *"); - test(PT::is_substr_nc(L"", L""), true); - test(PT::is_substr_nc(L"", L"a"), true); - test(PT::is_substr_nc(L"a", L""), false); - test(PT::is_substr_nc(L"a", L"a"), true); - test(PT::is_substr_nc(L"a", L"ab"), true); - test(PT::is_substr_nc(L"abc", L"abb"), false); - test(PT::is_substr_nc(L"abc", L"abcd"), true); - test(PT::is_substr_nc(L"XYZ", L"XYZabc"), true); - test(PT::is_substr_nc(L"XYZ", L"xYz"), true); - test(PT::is_substr_nc(L"hello world", L"hello world"), true); - test(PT::is_substr_nc(L"hello world", L"abc hello world"), false); - test(PT::is_substr_nc(L"hello world", L"hello worldabc"), true); - test(PT::is_substr_nc(L"Hello World", L"hello world"), true); - test(PT::is_substr_nc(L"hello world", L"Hello World"), true); + test(pt::is_substr_nc(L"", L""), true); + test(pt::is_substr_nc(L"", L"a"), true); + test(pt::is_substr_nc(L"a", L""), false); + test(pt::is_substr_nc(L"a", L"a"), true); + test(pt::is_substr_nc(L"a", L"ab"), true); + test(pt::is_substr_nc(L"abc", L"abb"), false); + test(pt::is_substr_nc(L"abc", L"abcd"), true); + test(pt::is_substr_nc(L"XYZ", L"XYZabc"), true); + test(pt::is_substr_nc(L"XYZ", L"xYz"), true); + test(pt::is_substr_nc(L"hello world", L"hello world"), true); + test(pt::is_substr_nc(L"hello world", L"abc hello world"), false); + test(pt::is_substr_nc(L"hello world", L"hello worldabc"), true); + test(pt::is_substr_nc(L"Hello World", L"hello world"), true); + test(pt::is_substr_nc(L"hello world", L"Hello World"), true); } @@ -1823,51 +1820,51 @@ void test_text45() reset_test_counter("is_substr_nc std::string"); std::string str1, str2; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = ""; str2 = "a"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = "a"; str2 = "a"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = "a"; str2 = ""; - test(PT::is_substr_nc(str1, str2), false); + test(pt::is_substr_nc(str1, str2), false); str1 = "abcd"; str2 = "abcd"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = "abcdefg"; str2 = "abcd"; - test(PT::is_substr_nc(str1, str2), false); + test(pt::is_substr_nc(str1, str2), false); str1 = "abcd"; str2 = "abcdefg"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = "aBCd"; str2 = "abcd"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = "abcd"; str2 = "aBCd"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = "aBCdefg"; str2 = "abcd"; - test(PT::is_substr_nc(str1, str2), false); + test(pt::is_substr_nc(str1, str2), false); str1 = "aBCd"; str2 = "abcdefg"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = "abcd"; str2 = "aBCdefg"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); } @@ -1877,51 +1874,51 @@ void test_text46() reset_test_counter("is_substr_nc std::wstring"); std::wstring str1, str2; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = L""; str2 = L"a"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = L"a"; str2 = L"a"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = L"a"; str2 = L""; - test(PT::is_substr_nc(str1, str2), false); + test(pt::is_substr_nc(str1, str2), false); str1 = L"abcd"; str2 = L"abcd"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = L"abcdefg"; str2 = L"abcd"; - test(PT::is_substr_nc(str1, str2), false); + test(pt::is_substr_nc(str1, str2), false); str1 = L"abcd"; str2 = L"abcdefg"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = L"aBCd"; str2 = L"abcd"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = L"abcd"; str2 = L"aBCd"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = L"aBCdefg"; str2 = L"abcd"; - test(PT::is_substr_nc(str1, str2), false); + test(pt::is_substr_nc(str1, str2), false); str1 = L"aBCd"; str2 = L"abcdefg"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); str1 = L"abcd"; str2 = L"aBCdefg"; - test(PT::is_substr_nc(str1, str2), true); + test(pt::is_substr_nc(str1, str2), true); } diff --git a/tests/convert.h b/tests/convert.h index 431697e..e3c0421 100644 --- a/tests/convert.h +++ b/tests/convert.h @@ -46,14 +46,10 @@ namespace pt_convert_tests - - void make_tests(); - - } } diff --git a/tests/csvparser.cpp b/tests/csvparser.cpp index 6fce734..eecbc3e 100644 --- a/tests/csvparser.cpp +++ b/tests/csvparser.cpp @@ -44,14 +44,11 @@ namespace pt { -// remove me in the future (when PT will be changed to pt) -using namespace PT; - - namespace pt_csvparser_tests { + void test_csvparser(const char * input_str, const char * expected_json) { CSVParser csv_parser; diff --git a/tests/mainoptionsparser.cpp b/tests/mainoptionsparser.cpp index 646b9a7..569b7aa 100644 --- a/tests/mainoptionsparser.cpp +++ b/tests/mainoptionsparser.cpp @@ -45,13 +45,10 @@ namespace pt { -// remove me in the future (when PT will be changed to pt) -using namespace PT; - - namespace pt_mainoptions_tests { + struct MainOptionsParserOutputTest { MainOptionsParser::Status status; @@ -83,7 +80,7 @@ bool has_space_in_str(const char * arg) { while( *arg ) { - if( PT::is_white((wchar_t)*arg) ) + if( is_white((wchar_t)*arg) ) return true; arg += 1;