Author: teemperor Date: Wed Sep 25 03:07:23 2019 New Revision: 372837 URL: http://llvm.org/viewvc/llvm-project?rev=372837&view=rev Log: [lldb] Test data formatters for empty strings
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/main.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py?rev=372837&r1=372836&r2=372837&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py Wed Sep 25 03:07:23 2019 @@ -59,16 +59,23 @@ class LibcxxStringDataFormatterTestCase( self.expect( "frame variable", substrs=[ + '(%s::wstring) wempty = L""'%ns, '(%s::wstring) s = L"hello world! ××× ×××!"'%ns, '(%s::wstring) S = L"!!!!"'%ns, '(const wchar_t *) mazeltov = 0x', 'L"××× ×××"', + '(%s::string) empty = ""'%ns, '(%s::string) q = "hello world"'%ns, '(%s::string) Q = "quite a long std::strin with lots of info inside it"'%ns, '(%s::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"'%ns, '(%s::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0ã¦ã ã«ãä¨ãã §æ§ ãã ã¸ç¦ç©¤è¥© ãã馩ãªã§ 䤦ç£"'%ns, '(%s::u16string) u16_string = u"Ãæ°´æ°¶"'%ns, - '(%s::u32string) u32_string = U"ðð ðð"'%ns]) + # FIXME: This should have a 'u' prefix. + '(%s::u16string) u16_empty = ""'%ns, + '(%s::u32string) u32_string = U"ðð ðð"'%ns, + # FIXME: This should have a 'U' prefix. + '(%s::u32string) u32_empty = ""'%ns +]) self.runCmd("n") Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp?rev=372837&r1=372836&r2=372837&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp Wed Sep 25 03:07:23 2019 @@ -2,16 +2,20 @@ int main() { + std::wstring wempty(L""); std::wstring s(L"hello world! ××× ×××!"); std::wstring S(L"!!!!"); const wchar_t *mazeltov = L"××× ×××"; + std::string empty(""); std::string q("hello world"); std::string Q("quite a long std::strin with lots of info inside it"); std::string TheVeryLongOne("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890someText1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"); std::string IHaveEmbeddedZeros("a\0b\0c\0d",7); std::wstring IHaveEmbeddedZerosToo(L"hello world!\0ã¦ã ã«ãä¨ãã §æ§ ãã ã¸ç¦ç©¤è¥© ãã馩ãªã§ 䤦ç£", 38); std::u16string u16_string(u"Ãæ°´æ°¶"); + std::u16string u16_empty(u""); std::u32string u32_string(U"ðð ðð"); + std::u32string u32_empty(U""); S.assign(L"!!!!!"); // Set break point at this line. return 0; } Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py?rev=372837&r1=372836&r2=372837&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py Wed Sep 25 03:07:23 2019 @@ -52,12 +52,15 @@ class StdStringDataFormatterTestCase(Tes # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) + var_wempty = self.frame().FindVariable('wempty') var_s = self.frame().FindVariable('s') var_S = self.frame().FindVariable('S') var_mazeltov = self.frame().FindVariable('mazeltov') + var_empty = self.frame().FindVariable('empty') var_q = self.frame().FindVariable('q') var_Q = self.frame().FindVariable('Q') + self.assertTrue(var_wempty.GetSummary() == 'L""', "wempty summary wrong") self.assertTrue( var_s.GetSummary() == 'L"hello world! ××× ×××!"', "s summary wrong") @@ -65,6 +68,7 @@ class StdStringDataFormatterTestCase(Tes self.assertTrue( var_mazeltov.GetSummary() == 'L"××× ×××"', "mazeltov summary wrong") + self.assertTrue(var_empty.GetSummary() == '""', "empty summary wrong") self.assertTrue( var_q.GetSummary() == '"hello world"', "q summary wrong") Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/main.cpp?rev=372837&r1=372836&r2=372837&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/main.cpp (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/main.cpp Wed Sep 25 03:07:23 2019 @@ -2,9 +2,11 @@ int main() { + std::wstring wempty(L""); std::wstring s(L"hello world! ××× ×××!"); std::wstring S(L"!!!!"); const wchar_t *mazeltov = L"××× ×××"; + std::string empty(""); std::string q("hello world"); std::string Q("quite a long std::strin with lots of info inside it"); S.assign(L"!!!!!"); // Set break point at this line. _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits