wxWidgets/tests
Vadim Zeitlin 227989f3e9 Write correct number of bytes in wxFile::Write(wxString).
This function was broken for conversions using more than one byte per
character (e.g. UTF-16 or UTF-32) and also even for UTF-8 for strings
containing NUL bytes as it used strlen() to determine the number of bytes to
write out instead of using the really needed number.

Fix this by using the wxCharBuffer::length() method which always returns the
correct value.

Also add a wxFile unit test verifying that it can correctly read back a string
written using any of UTF-8, UTF-16 or UTF-32.

Closes #11192.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-12 22:40:42 +00:00
..
archive Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
arrays Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
base64 Never overflow the output buffer in wxBase64Decode(). 2009-08-23 22:25:12 +00:00
benchmarks Rebake all the samples, demos and tests makefiles. 2009-09-12 13:38:08 +00:00
cmdline Fix bug with parsing concatenated switches in wxCmdLineParser. 2009-09-07 23:00:05 +00:00
config Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
controls fix bug in generic wxTreeCtrl: calling SelectItem(true) on an already selected item shouldn't toggle its selection (see #10830) 2009-06-06 14:15:06 +00:00
datetime Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
events fix errors in EvtHandlerTestCase::BindFunctor() in optimized build: apparently compiler is smart enough to detect that the same object can be used for all temporaries 2009-05-17 10:56:14 +00:00
exec suppress output from the test commands; use CPPUNIT_ASSERT_EQUAL() whenever possible 2009-04-13 17:33:33 +00:00
file Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
filekind Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
filename add more tests for wxFileName::Normalize(DOTS) (see #10960) 2009-07-03 22:07:22 +00:00
filesys Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
font add wxGetLinuxDistributionInfo() and wxPlatformInfo::GetLinuxDistribution() functions; also add to wxPlatformInfo the GetOperatingSystemDescription(), GetDesktopEnvironment(), GetOperatingSystemDirectory() functions to group in the same class (wxPlatformInfo) all available platform-detection functions 2009-06-02 13:01:41 +00:00
fontmap Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
formatconverter Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
geometry compilation fixes for VC6 2008-01-13 01:13:03 +00:00
graphics Forward port wxGraphicsBitmap cairo implementation, and fix the credit info in measuring.cpp 2009-06-20 23:33:55 +00:00
hashes Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
html added a test to check if wxHtmlWindow::SelectionToText() inserts \n characters correctly 2008-10-15 15:55:25 +00:00
image Correct wxImage::Size() again; add unit tests for it. 2009-08-30 21:43:11 +00:00
intl fix test failure on glibc systems which do not use %T; also replace CompareTimeFormats() with a macro to get failure messages on the right line 2009-04-04 12:09:54 +00:00
lists Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
log Include wx/filefn.h to fix PCH-less compilation. 2009-08-18 11:44:31 +00:00
longlong Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
mbconv Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
misc Fix buffer overflow in wxURLDataObject. 2009-08-30 17:25:42 +00:00
net disable IPC test completely as it prevents the test program from running to completion when it hangs (for still unknown reason) 2009-03-11 13:15:45 +00:00
regex Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
scopeguard get rid of special WX_ASSERT_FOO_EQUAL macros by defining CppUnit::assertEquals() overloads for wx types 2008-07-18 23:07:23 +00:00
streams Extract TestFile class in a separate header. 2009-09-12 22:40:35 +00:00
strings Output the extracted number from wxString::ToXXX() even if it returns false. 2009-08-30 17:25:19 +00:00
textfile Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
thread chanegd wxTlsValue to be pointer-like instead of value-like which doesn't work for UDTs; use __thread keyword with mingw32 >= 4.3 too; use library-based thread-specific variables support in wxString cache now that it is fixed to work there; finally added a unit test for TLS stuff 2008-08-29 23:28:42 +00:00
uris Globally replace _T() with wxT(). 2009-07-23 20:30:22 +00:00
vectors Added wxVector::swap(). 2009-07-12 17:00:29 +00:00
weakref remove the test of weak references classes size, it's implementation-dependent 2008-01-16 02:03:10 +00:00
window don't take the min size into account when setting the window size explicitly in wxGTK, just as wxMSW doesn't do it; mention this in the docs and added a unit test to enforce this 2008-05-25 03:08:31 +00:00
xlocale use "ul" suffix instead of cast to unsigned long; this is not only shorter but also avoids gcc warning about working correctly only in C90 2009-04-17 13:06:27 +00:00
xml Don't append text following CDATA section to its node itself. 2009-08-24 21:42:27 +00:00
dummy.cpp Empty line at the end. 2004-11-22 15:12:29 +00:00
horse.ani add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.bmp add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.cur add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.gif add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.ico add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.jpg add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.pcx add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.png add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.pnm add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.tga add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.tif add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
horse.xpm add wxImage test units to test loading from both seekable and non-seekable streams 2009-06-01 11:46:36 +00:00
makefile.bcc Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
makefile.gcc Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
Makefile.in Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
makefile.vc Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
makefile.wat Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
runtests.bat adds proper detection of tests success/failure; clear that "error level" != "return code" 2009-03-23 14:57:10 +00:00
test_printfbench.dsp link with wininet.lib under Windows to avoid linking errors in wxUSE_URL_NATIVE==1 build (#10338) 2009-01-15 13:33:51 +00:00
test_test_gui.dsp Rebake all the samples, demos and tests makefiles. 2009-09-12 13:38:08 +00:00
test_test.dsp Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
test_vc7_printfbench.vcproj update bakefile to 0.2.6 2009-04-24 10:36:24 +00:00
test_vc7_test_gui.vcproj Rebake all the samples, demos and tests makefiles. 2009-09-12 13:38:08 +00:00
test_vc7_test.vcproj Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
test_vc8_printfbench.vcproj update bakefile to 0.2.6 2009-04-24 10:36:24 +00:00
test_vc8_test_gui.vcproj Rebake all the samples, demos and tests makefiles. 2009-09-12 13:38:08 +00:00
test_vc8_test.vcproj Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
test_vc9_printfbench.vcproj update bakefile to 0.2.6 2009-04-24 10:36:24 +00:00
test_vc9_test_gui.vcproj Rebake all the samples, demos and tests makefiles. 2009-09-12 13:38:08 +00:00
test_vc9_test.vcproj Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
test_vc9.sln refactor printf benchmarks to fit the new wxWidgets benchmarking framework; fix tests and benchmarks builds (at least on linux) which were failing because of wrong order of <wx-lib> tags in the bakefiles 2009-05-30 13:54:22 +00:00
test.bkl Write correct number of bytes in wxFile::Write(wxString). 2009-09-12 22:40:42 +00:00
test.cpp disable warnings about unused parameters in CppUnit headers 2009-06-06 23:22:37 +00:00
testdata.fc moved Unicode tests to testsuite (patch 943945) 2004-04-30 20:26:14 +00:00
testfile.h Extract TestFile class in a separate header. 2009-09-12 22:40:35 +00:00
testprec.h disable MSVC 8+ warning about using Unicode characters as we do want to use them 2009-06-06 23:24:57 +00:00