Commit Graph

866 Commits

Author SHA1 Message Date
Vadim Zeitlin
cbab155657 No real changes, just fix a typo in comments and documentation.
Use "surprising" instead of (common) "surprizing" misspelling.

Closes #11627.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-14 18:02:26 +00:00
Vadim Zeitlin
4cb0e8d05c Fix wxConvAuto behaviour when it is used by wxTextInputStream.
wxConvAuto implicitly supposed that the chunk of data passed to it for
translation was big enough to allow it to at least detect the BOM from it.
However this isn't necessarily the case and never is with wxTextInputStream
which reads the bytes one by one.

Fix this by waiting until we have enough data to be able to detect the BOM.
This still doesn't fix the problem with streams without BOM and the
corresponding unit test still fails -- it will need to be fixed at the level
of wxTextInputStream itself later but handling correctly the cases when a BOM
is present is already better than before.

See #11570.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-04 12:22:49 +00:00
Vadim Zeitlin
595c23b34e Compilation fix for VC6 after r63061.
VC6 doesn't support empty struct initializers apparently.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-04 12:22:34 +00:00
Vadim Zeitlin
8b7d411f14 Correctly parse times without seconds in wxDateTime::ParseTime().
This was always supposed to work but never did because of a typo in the "24
hour format without seconds" format specification. Fix this by removing the
extra "%S" from it and add a test for this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-04 11:05:47 +00:00
Kevin Ollivier
da8b1d4b3b Rebake from clean wx tree.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-04 00:45:45 +00:00
Michael Wetherell
9e477451a1 Add another test for sparse file support so that the large file tests can run
as part of the default suite for more platforms.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-30 17:44:09 +00:00
Michael Wetherell
c896c76129 Repair the stream tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-30 17:39:47 +00:00
Michael Wetherell
224d978ffb Add support for large stdio files for VC 8+. What versions of the other Windows
compilers?


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-22 21:22:59 +00:00
Vadim Zeitlin
404013f849 Correct wxDateTime::GetWeekOfMonth() for days in the beginning of January.
This function was implemented in terms of GetWeekOfYear() which made it tricky
to get it right as GetWeekOfYear() can, correctly, return week number for the
previous year for the first days of January (and also from the next one for
the last days of December).

Replace this implementation with a simple one directly counting the number of
weeks since the first of the month, this seems to be much simpler and does
pass the new unit test case which the old version failed.

Also make the unit test failures more informative by using
WX_ASSERT_EQUAL_MESSAGE() instead of CPPUNIT_ASSERT_EQUAL().

See #11561.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-17 17:51:12 +00:00
Vadim Zeitlin
94b6ce7f4b Use X64 machine type for MSVC linker instead of old AMD64.
The officially supported machine type name is X64 now, even if AMD64 is still
supported.

Closes #10711.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-08 16:36:37 +00:00
Vadim Zeitlin
2730723380 Correct two bugs in wxMBConv::FromWChar() with non NUL-terminated strings.
The variable "lenChunk" was incorrectly used as the length of the wide string
chunk which could result in wrong output.

Worse, the output buffer could be overflown for the final chunk because it
didn't have to have enough space for the trailing NUL(s) in it.

Fix both bugs and added unit tests for them.

Based on patch by Kuang-che Wu.

Closes #11486.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-06 02:30:05 +00:00
Vadim Zeitlin
e01a788ee0 Add support for MSW unique volume names to wxFileName.
Recognize the paths starting with "\\?\Volume{GUID}" under MSW and provide a
way to test for them.

Closes #8874.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62782 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-05 17:31:00 +00:00
Vadim Zeitlin
874dbd3a4a Allow calling wxStrchr() with a narrow string and wide character.
Calls to wxStrchr(char-string, wide-char) would previously fail if wide
character couldn't be converted to a single character in the current locale
encoding. Change it to simply return NULL in this case as it's a safe and
useful generalization: a narrow string will never contain a wide character not
representable in the current locale.

Add wxUniChar::GetAsChar() to help with implementing this.

Closes #11487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-28 14:37:03 +00:00
Vadim Zeitlin
009f89f75d Make the assert in SettingsTestCase::GlobalFonts() more informative.
Show the index of the font and the face name which was invalid.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-24 00:01:51 +00:00
Jaakko Salli
7db064f60f Added typeinfo.h which implements wxTypeId, using C++ RTTI if available. wxAny and Unbind<>() code are updated to use it. Added and updated related unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-19 19:27:24 +00:00
Kevin Ollivier
f82b7036e8 Rebake after last commit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-18 19:22:58 +00:00
Vadim Zeitlin
acaa833787 Fix unit test added in r62561 to work under Windows too.
The unit test checking that slashes were allowed in UNCs too didn't work under
Windows because GetPath() returned volume as part of the path there (and also
used backslashes by default), fix it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-09 18:20:05 +00:00
Vadim Zeitlin
7b611a3ae9 Recognize UNCs starting with forward slashes too in wxFileName.
Treat \\share\path and //share/path in the same way (for wxPATH_DOS paths).

Add a test for UNC parsing to the unit test.

Closes #11376.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-05 14:59:39 +00:00
Kevin Ollivier
a7ebaf0ddd Bakefile 0.2.8 rebake.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 20:56:47 +00:00
Kevin Ollivier
dbc7ceb925 Initial ShowWithoutActivating implementations for Mac and Windows, and attempt to improve IsActive behavior on Mac. Also adding ShowWithoutActivating() and Show/Hide tests, but until the mainloop issues are resolved, not adding them to tests.bkl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-30 05:04:47 +00:00
Vadim Zeitlin
8c9833d09e Rebaked using post-0.2.7 svn version of bakefile.
Unfortunately 0.2.7 release contained a bug in msvc backend which resulted in
warnings generated for each file compiled. Apply the fix from bakefile svn to
fix this (and test if no other problems are found).

Also update all makefile.unx after changes of r62477.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-23 17:48:21 +00:00
Vadim Zeitlin
77241feb3f Use an even more informative error message in wxFSW unit test.
Dump information about both events when we received two of them instead of the
(single) expected one.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-23 11:44:57 +00:00
Vadim Zeitlin
1c9c8e88c2 Give more informative error in wxFSW test.
Output more details when more than one event is unexpectedly received.
Hopefully this will allow to debug the test failure at build bot slaves which
doesn't seem to be happening locally.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 23:54:55 +00:00
Vadim Zeitlin
d5236dfffd Fix g++ compilation of wxFileSystemWatcher test after VC6 fix.
Enums can't be used to deduce template parameters so cast WAIT_DURATION to int
explicitly before passing it to wxString::Format().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62481 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 23:54:47 +00:00
Vadim Zeitlin
771ce939f3 Fix wxFSW test compilation with VC6.
Work around an internal compiler error and don't initialize static variable
when declaring it as VC6 doesn't support this.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 16:57:41 +00:00
Vadim Zeitlin
7880889720 Rebake everything using bakefile 0.2.7.
Also updated aclocal inputs and regenerated configure.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 16:53:10 +00:00
Vadim Zeitlin
6b8ef0b35d Merge SOC2009_FSWATCHER branch into trunk.
Merges everything from the branch with only some minor changes, mostly renamed
wxUSE_FSWATCHER_{INOTIFY,KQUEUE} to wxHAS_{INOTIFY,KQUEUE}.

Add wxFileSystemWatcher and related classes.

Also introduces wxEventLoopSource.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 11:35:43 +00:00
Vadim Zeitlin
40152925d5 Extract operator<<(ostream, wxFileName) from filename test.
Putting this function in a header allows to reuse it in other tests, e.g. the
upcoming wxFileSystemWatcher one.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 11:34:43 +00:00
Vadim Zeitlin
5ba859da5c Remove unwanted solution files from the repository.
Remove VC9-only solution files from a couple of tests/utils/demos (there is
no reason at all to have only VC9 solutions: either we have all of [789] or
none of them) and also remove all solutions files for the ribbon sample which
were probably added mistakenly in the first place (as no other sample has
them).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 09:40:42 +00:00
Kevin Ollivier
d5e7ffcf7a Make sure all Bakefile formats that use CRLF line feeds are set to use CRLF in SVN.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62327 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-08 04:07:02 +00:00
Vadim Zeitlin
bbb0ff36db Fix another off-by-1 bug in wxMBConv::ToWChar().
When converting a fixed number of characters we need to take any NULs inside
the buffer being converted into account for our return value -- but this
wasn't done and converting 2 characters 'x' and '\0' returned only 1, even if
the length 2 was explicitly specified.

Fix this bug and add a unit test checking for it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-26 13:31:27 +00:00
Vadim Zeitlin
4bc9acbe16 No changes, just convert file to UTF-8.
All files in svn are supposed to use UTF-8 now so convert this one to UTF-8
too before committing more changes to it (which would be otherwise rejected by
pre-commit hook).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-26 13:31:20 +00:00
Vadim Zeitlin
884ca4e484 Abort on asserts in worker threads.
Throwing an exception from worker threads is useless as it is not caught by
our wxUnitTestProtector which only protects the main thread, so abort
immediately to be sure to provide at least some information about the problem
as otherwise nothing may be output at all and the program can end up
deadlocked.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-21 14:45:37 +00:00
Vadim Zeitlin
7b7ad6a7f2 Fix harmless unused variable warning.
The value of wxColour::Alpha() was assigned to a temporary variable which
wasn't used afterwards and Mac OS g++ warned about it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-21 08:44:25 +00:00
Vadim Zeitlin
97051666f0 Add missing header to fix wxAny test compilation under OS X.
And probably other Unix systems not using PCH.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61980 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-20 12:37:11 +00:00
Vadim Zeitlin
b0edecea48 Add wxColour::{Set,Get}RGB[A]().
These methods allow to operate with all 3 or 4 colour channels at once.

Add their implementation, documentation and a unit test for wxColour
exercising them.

Closes #9918.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-19 16:29:50 +00:00
Vadim Zeitlin
39601a7f74 Set svn properties correctly for the newly added files.
Set svn:keyword and, most importantly, svn:eol-style, to avoid having files
with DOS line endings in svn, for the new files added by r61971.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-19 15:41:08 +00:00
Jaakko Salli
9ae96ec2bd Fixed wxAny tests for VC6
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-19 10:13:31 +00:00
Jaakko Salli
178c77606f wxAny initial commit (closes #10932)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-19 08:51:11 +00:00
Vadim Zeitlin
3d156e937a Provide implementation for wxArrayString::resize().
This method was declared but not implemented in wxUSE_STL==0 build.

Also add unit test for this function.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-16 23:18:48 +00:00
Vadim Zeitlin
bf24fcddc3 Fix test compilation under OS X.
wxFileOffset and ssize_t are not the same type under this platform so using
CPPUNIT_ASSERT_EQUAL() with the arguments of these types fails. Use ssize_t
instead of wxFileOffset to fix this.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-13 12:26:03 +00:00
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
Vadim Zeitlin
caa96da739 Extract TestFile class in a separate header.
This allows to reuse it in the other tests which need to create a temporary
file automatically destroyed on test exit.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-12 22:40:35 +00:00
Vadim Zeitlin
d12d9edacb Rebake all the samples, demos and tests makefiles.
This should have been committed together with the changes to the debug flags
handling in build/bakefiles in r61887.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-12 13:38:08 +00:00
Vadim Zeitlin
8076df5d81 regenerated
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-12 13:35:16 +00:00
Vadim Zeitlin
758f356c53 Fix bug with parsing concatenated switches in wxCmdLineParser.
The constructs such as "-abcd" were not parsed correctly, i.e. the same as "-a
-b -c -d" because the code tried to parse a non-existent option "abcd" even if
it was supposed to not do this -- fix this.

Closes #11180.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-07 23:00:05 +00:00
Vadim Zeitlin
2e51fb3041 Correct wxImage::Size() again; add unit tests for it.
wxImage::Size() didn't handle the paste position correctly.

Closes #7874.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-30 21:43:11 +00:00
Vadim Zeitlin
791f7574a0 Fix buffer overflow in wxURLDataObject.
The code in CFSTR_SHELLURLDataObject::GetDataHere() was confused by
ANSI/Unicode and ended up overwriting output buffer because of it. Moreover,
this function was actually completely unnecessary as the base class version
did work correctly.

Closes #11102 (thanks to Tim Kosse).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-30 17:25:42 +00:00
Vadim Zeitlin
69d31e3130 Output the extracted number from wxString::ToXXX() even if it returns false.
After the changes in r50710 wxString numeric conversion functions didn't
update their output parameter any more if the conversion failed because not
entire string was converted. This was incompatible with the old behaviour
which some existing code did rely on, so restore it and now always return the
number which was extracted from the beginning of the string if we found
anything at all, even if the function returns false.

Add unit test for the correct behaviour and updated the documentation.

Closes #11126.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61786 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-30 17:25:19 +00:00
Vadim Zeitlin
a6cf6bcfb4 Don't append text following CDATA section to its node itself.
Reset wxXmlParsingContext::lastAsText flag when CDATA section ends to avoid
appending the text following it to its node. Instead new text nodes should be
created for it.

Also update the unit test to not work around the bug any more.

Closes #10552.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-24 21:42:27 +00:00