Arseny Kapoulkine
c40fd364ce
tests: Add tests for loading special files
...
New tests try to load a folder as an XML document, and a device. Both
are intended to exercise some otherwise non-hittable error paths in
load_file implementation.
2017-06-15 07:23:49 -07:00
Arseny Kapoulkine
5115db7409
tests: Fix unused variable warning in some compilers
...
The variable is being assigned to but never read when exceptions are
disabled.
2016-11-19 00:19:29 -08:00
Stephan Beyer
f7aa65db8a
Fix whitespace issues
...
Git warns when it finds "whitespace errors". This commit gets
rid of these whitespace errors for code and adoc files.
2016-01-24 14:05:44 +01:00
Arseny Kapoulkine
f04b56e178
Permit custom allocation function to throw
...
Ensure that all the necessary cleanup is performed in case the allocation fails
with an exception - files are closed, buffers are reclaimed, etc.
Any test that triggers a simulated out-of-memory condition is ran once again
with a throwing allocation function. Unobserved std::bad_alloc count as test
failures and require CHECK_ALLOC_FAIL macro.
Fixes #17 .
2015-04-12 21:46:48 -07:00
Arseny Kapoulkine
4e004176ba
tests: Improve out-of-memory tests
...
Previously there was no guarantee that the tests that check for out of memory
handling behavior are actually correct - e.g. that they correctly simulate out
of memory conditions.
Now every simulated out of memory condition has to be "guarded" using
CHECK_ALLOC_FAIL. It makes sure that every piece of code that is supposed to
cause out-of-memory does so, and that no other code runs out of memory
unnoticed.
2015-04-11 22:46:08 -07:00
Arseny Kapoulkine
0e59ea8234
tests: Add a way for tests to verify allocation failure
...
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1081 99668b35-9821-0410-8761-19e4c4f06640
2014-10-26 03:46:28 +00:00
Arseny Kapoulkine
7258aea09b
tests: Assert on out-of-memory in tests
...
This should never happen but can improve debugging experience for
work-in-progress changes since that avoids memcpy() into negative memory
space (debugger can't backtrace from failed memcpy since it does not set
up the stack frame).
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1070 99668b35-9821-0410-8761-19e4c4f06640
2014-10-21 03:33:47 +00:00
Arseny Kapoulkine
e33e1083ad
tests: Fix WinCE compilation
...
git-svn-id: https://pugixml.googlecode.com/svn/trunk@991 99668b35-9821-0410-8761-19e4c4f06640
2014-02-26 22:37:40 +00:00
Arseny Kapoulkine
bd960159dd
tests: Write temporary files to executable folder.
...
Temp folder is the root folder on Windows; writing to the folder may require administrator rights.
We can't use current folder for temporaries because tests from different configurations can be running
in parallel, but executable folder is always safe since we only run each executable once.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@984 99668b35-9821-0410-8761-19e4c4f06640
2014-02-19 06:21:51 +00:00
Arseny Kapoulkine
9ba26b94c7
Replace memory-management functions before every test.
...
In case a test sets memory-management functions to perform custom testing and fails midway,
all subsequent tests that rely on custom memory handling (i.e. threshold) can fail unexpectedly.
Setting up the functions before every test fixes this, making all tests self-contained.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@976 99668b35-9821-0410-8761-19e4c4f06640
2014-02-10 16:56:55 +00:00
arseny.kapoulkine@gmail.com
199b97a851
tests: Miscellaneous fixes
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@850 99668b35-9821-0410-8761-19e4c4f06640
2012-03-06 16:56:45 +00:00
arseny.kapoulkine@gmail.com
04629118db
tests: Android compilation fixes
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@846 99668b35-9821-0410-8761-19e4c4f06640
2012-03-06 08:49:58 +00:00
arseny.kapoulkine@gmail.com
9133322c4c
tests: Minor fixes for WinCE compilation
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@834 99668b35-9821-0410-8761-19e4c4f06640
2012-02-19 09:05:23 +00:00
arseny.kapoulkine
5f318e056e
tests: Fixed C++/CLI compilation warning
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@807 99668b35-9821-0410-8761-19e4c4f06640
2011-02-16 20:00:54 +00:00
arseny.kapoulkine
d99745be21
Enabled many additional GCC warnings (most notably -Wshadow and -Wold-style-cast), fixed the code accordingly
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@800 99668b35-9821-0410-8761-19e4c4f06640
2010-12-19 10:16:37 +00:00
arseny.kapoulkine
954de8f89a
tests: Various compilation fixes for BCC and MSVC6
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@702 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29 16:28:10 +00:00
arseny.kapoulkine
84dce2eb46
tests: Remove new/delete overrides (all pugi code now uses custom allocators)
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@668 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29 15:30:14 +00:00
arseny.kapoulkine
ea0dbe7884
tests: Deallocation of null pointer is illegal for custom allocators
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@656 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29 15:20:27 +00:00
arseny.kapoulkine
a9bc2d8873
tests: Fixed tests for wchar_t mode, added dummy std::cout/wcout usage for MSVC in order to create locales beforehand (avoids memory leaks during tests), minor additional test fixes
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@629 99668b35-9821-0410-8761-19e4c4f06640
2010-08-04 20:10:10 +00:00
arseny.kapoulkine
724cb46a72
tests: New and delete operators now use test allocator and thus are subject to leak detection and memory threshold failure
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@624 99668b35-9821-0410-8761-19e4c4f06640
2010-08-03 12:19:13 +00:00
arseny.kapoulkine
7d24b9b565
Set svn:eol-style to native for all text files
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@607 99668b35-9821-0410-8761-19e4c4f06640
2010-07-19 09:57:32 +00:00
arseny.kapoulkine
2dec6dd505
tests: Added Xbox360 and PS3 toolset support
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@602 99668b35-9821-0410-8761-19e4c4f06640
2010-07-15 09:29:32 +00:00
arseny.kapoulkine
ab72b14d17
Internal XML parsing error handling is done via setjmp/longjmp, all allocation errors are now handled correctly (parser returns status_out_of_memory, modification functions return errors); added tests for some out of memory situations
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@520 99668b35-9821-0410-8761-19e4c4f06640
2010-06-13 19:24:20 +00:00
arseny.kapoulkine
57702ccba3
Improved memory leak detection
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@398 99668b35-9821-0410-8761-19e4c4f06640
2010-05-09 18:23:50 +00:00
arseny.kapoulkine
f542c5ebb8
Integrated changes from unicode branch to trunk
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@383 99668b35-9821-0410-8761-19e4c4f06640
2010-05-06 20:28:36 +00:00
arseny.kapoulkine
516e4d63ce
unicode: Fixed tests for Linux
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@280 99668b35-9821-0410-8761-19e4c4f06640
2010-04-20 20:46:42 +00:00
arseny.kapoulkine
a70f6b1a70
tests: CodeWarrior and BCC supported
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@195 99668b35-9821-0410-8761-19e4c4f06640
2009-10-29 21:47:37 +00:00
arseny.kapoulkine
1fdd096c80
tests: Tests can work without exceptions now
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@194 99668b35-9821-0410-8761-19e4c4f06640
2009-10-29 08:11:22 +00:00
arseny.kapoulkine
fc602fd375
tests: Supported all pugixml compilation modes
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@191 99668b35-9821-0410-8761-19e4c4f06640
2009-10-29 07:17:30 +00:00
arseny.kapoulkine
0640f87859
tests: More fixes and toolsets support
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@190 99668b35-9821-0410-8761-19e4c4f06640
2009-10-28 22:22:19 +00:00
arseny.kapoulkine
c4fbc83cd0
tests: Added memory leak detection
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@165 99668b35-9821-0410-8761-19e4c4f06640
2009-10-20 21:36:29 +00:00
arseny.kapoulkine
6db04f4320
tests: Added simple test framework, added a couple of tests
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@140 99668b35-9821-0410-8761-19e4c4f06640
2009-10-10 21:36:03 +00:00
arseny.kapoulkine
52aa5325f3
Initial test building support along with a stub test file
...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@138 99668b35-9821-0410-8761-19e4c4f06640
2009-10-10 20:14:04 +00:00