Dmitry Marakasov
69bb914040
Improve SDL2Main library handling
2016-01-22 23:49:29 +03:00
Dmitry Marakasov
317cf6b391
Add more window tests
2016-01-21 22:05:47 +03:00
Dmitry Marakasov
4c2180e260
Add first portion of live window tests
2016-01-19 05:36:30 +03:00
Dmitry Marakasov
c92125053e
Extend Exception test coverage
2016-01-18 23:19:47 +03:00
Dmitry Marakasov
7dd543053c
Fix more SDL_main issues
...
- Always include SDL2/SDL_main.h in all tests to handle main() correctly
- Link all tests with SDL2pp (and thus with libSDL2main)
2016-01-05 18:28:52 +03:00
Dmitry Marakasov
0aede126fc
Fix main() signatures to be compatible with SDL_main
2015-12-15 22:06:56 +03:00
Dmitry Marakasov
8003052f32
Add Rect point getters
2015-11-27 20:21:49 +03:00
Dmitry Marakasov
e6f9cdbf4c
Add two arguments rect extension methods
2015-11-27 16:42:30 +03:00
Dmitry Marakasov
fa3cb7bcd9
Add std::hash support for Point and Rect
2015-11-26 13:42:16 +03:00
Dmitry Marakasov
95142b065c
Add Point and Rect less-than operator
...
This allows using them as map and set keys
2015-11-26 12:57:36 +03:00
Dmitry Marakasov
be5bc9d1de
Revamp compiler flag support detection logic
2015-09-17 16:02:36 +03:00
Dmitry Marakasov
1e6cefa86d
Add macro to check and enable C++ flag, add some clang warnings
2015-09-17 15:18:56 +03:00
Dmitry Marakasov
9c89af064d
Fix local variable shadowing
2015-09-16 22:51:39 +03:00
Dmitry Marakasov
18d58a4efb
Merge branch 'constexpr-pointrect'
2015-09-07 02:58:12 +03:00
Dmitry Marakasov
3953d77a9b
Add mixer live test
2015-09-07 01:59:59 +03:00
Dmitry Marakasov
f6d781b178
Rename gui tests to live tests
2015-09-07 01:58:50 +03:00
Dmitry Marakasov
e1c1417c50
Update testing.h (win32 related fixes)
2015-08-27 21:01:40 +03:00
Dmitry Marakasov
539e6c8fd1
Constexprify even more Rect methods
2015-07-07 21:28:30 +03:00
Dmitry Marakasov
beaa9ed3b8
Constexprify more Rect methods
2015-07-07 16:27:03 +03:00
Dmitry Marakasov
4f3256fda5
Constexprify Rect constructors
2015-07-07 15:42:03 +03:00
Dmitry Marakasov
5a55e91987
Constexprify Point arith ops
2015-07-07 15:41:45 +03:00
Dmitry Marakasov
d11345b6df
Initial Point constexpr support: constructors and comparison operators
2015-07-07 05:17:09 +03:00
Dmitry Marakasov
dacf1cbf04
Update Point arith test
2015-07-03 22:23:06 +03:00
Dmitry Marakasov
a31677af6a
Disable self-assignment warning for tests
...
As we deliberately do these self-assignments. Fixes -Werror build with clang 3.6.
2015-01-30 20:07:37 +03:00
Dmitry Marakasov
ca859c83a7
Fix test
2015-01-20 03:07:09 +03:00
Dmitry Marakasov
eccb504b4f
Use more EXPECT_EQUAL when applicable
2015-01-20 03:03:12 +03:00
Dmitry Marakasov
fdcbcddc1d
Implement stream output operators for Point and Rect
2015-01-20 02:56:34 +03:00
Dmitry Marakasov
fa7ba94957
Implement Point::Wrap
2015-01-20 02:38:16 +03:00
Dmitry Marakasov
ead93d1d69
Implement Rect::IntersectLine
2015-01-19 20:18:41 +03:00
Dmitry Marakasov
14f352dddd
Implement Rect::Extend
2015-01-19 19:57:40 +03:00
Dmitry Marakasov
0de09713c9
Add mutating Union method
2015-01-19 19:51:43 +03:00
Dmitry Marakasov
9d90792378
Implement Point::Clamp(Rect)
2015-01-19 01:05:05 +03:00
Dmitry Marakasov
0f4eea5aab
Add another variant of Rect::Contains()
2015-01-08 06:53:25 +03:00
Dmitry Marakasov
5ea7b7fc89
Update Rect tests
2014-12-30 00:14:36 +03:00
Dmitry Marakasov
7506b05a77
Implement Rect::Contains(Rect), add corresponding test
2014-12-29 22:04:43 +03:00
Dmitry Marakasov
518f9fff35
Add test for multiplication/division
2014-12-29 22:00:49 +03:00
Dmitry Marakasov
e18f54d302
Add test for Point/Rect construction and comparison from/with corresponding SDL objects
2014-12-29 21:58:38 +03:00
Dmitry Marakasov
f5216c309f
Add (failing) test for #22
2014-12-27 02:06:05 +03:00
Dmitry Marakasov
65b5446fd1
Axe out remaining uses of old Point/Rect API
2014-12-25 19:30:37 +03:00
Dmitry Marakasov
6d0213810b
Switch to Optional
...
Remove "valid" flag from Rect and Point, derive them directly from
SDL_Rect and SDL_Point structures, simplify logic. Now x/y/w/h member
variables are directly accessible and Rect/Point may be passed as
SDL_Rect/SDL_Point via pointer or reference.
Change all cases where Null Rects and Points were used to Optional.
invalid state related functions like Null(), IsNull() and Get() are
now deprecated but are not removed yet for compatibility sake.
2014-12-25 19:10:41 +03:00
Dmitry Marakasov
e6b31930b6
Add test for optional
2014-12-25 17:31:14 +03:00
Dmitry Marakasov
f8c6b2a9fb
Add operators to offset a Rect by a Point
2014-12-20 18:04:28 +03:00
Dmitry Marakasov
18fe309309
Remove demos into more suitable examples
...
Also add options for conditional build of tests and examples
2014-12-20 18:04:22 +03:00
Dmitry Marakasov
ae2968e2fe
Use SDL2 seek whence flags, not ones from stdio
2014-12-20 00:21:35 +03:00
Dmitry Marakasov
ef152c2a84
Merge branch 'header-tests'
...
Conflicts:
tests/CMakeLists.txt
2014-12-18 17:30:00 +03:00
Dmitry Marakasov
b8d3b08f10
Implement fixed integer r/w methods
2014-12-18 17:24:19 +03:00
Dmitry Marakasov
6813606086
Fix build on older CMake versions
...
MAKE_C_IDENTIFIER seem to only be available on relatively new CMake
versions, so replace it with similar REGEX REPLACE.
2014-12-18 16:55:27 +03:00
Dmitry Marakasov
d7987b33da
Allow ContainerRWops to work with both const and non-const containers
...
Analogus to how StreamRWops work. Also add more tests for
ContainerRWops.
2014-12-18 16:48:48 +03:00
Dmitry Marakasov
53aa26dec5
Make StreamRWops work with istream/ostream
...
Streams do not generally work well with RWops because
* streams have separate read and write pointers
* ostream doesn't allow you to determine how many bytes were actually written
* istream and ostream have separate set of functions
Try my best to support streams in RWops though, engaging some template
magic:
* provide separate template implementations of all operations which
depend on whether stream is an istream or ostream. This allows to
e.g. return 0 immediately for an attempt to write() to istream.
* disallow StreamRWops for classes which are both istream and ostream
to not run into ambiguity of separate read/write pointers
* for read failure, but partially read object back to the stream to not
lose data for following read (not sure that e.g. fread behaves so
though; I'll anyway expect user to Seek() after read or write failure)
* for write failure, there's no way to avoid leaking partial data to the
stream
In general, it is best to use this container as read-only.
Also add tests for StreamRWops
2014-12-18 16:23:22 +03:00
Dmitry Marakasov
c5f7de0c46
Make header tests completely automatic
2014-12-18 14:54:53 +03:00