12 Commits

Author SHA1 Message Date
Dmitry Marakasov
18f894cb9f Extens RWops tests 2017-04-21 18:17:09 +03:00
Dmitry Marakasov
24482d85f6 Follow SDL2 include path conventions
Though these are broken and error prone, as they ignore the possibility
of conflicts between SDL, SDL2 and wrappers thereof discarding useful
include path prefix (SDL2/), since SDL and satellite libraries follow
these it's too hard to stay away.

So don't use prefixes for SDL include paths any longer.
2017-02-08 13:19:04 +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
9c89af064d Fix local variable shadowing 2015-09-16 22:51:39 +03:00
Dmitry Marakasov
ae2968e2fe Use SDL2 seek whence flags, not ones from stdio 2014-12-20 00:21:35 +03:00
Dmitry Marakasov
b8d3b08f10 Implement fixed integer r/w methods 2014-12-18 17:24:19 +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
c73bd885c5 Name header file after class it defines 2014-12-18 14:29:45 +03:00
Dmitry Marakasov
e3ad1a4ad7 Add custom RWops for use with constant containers 2014-09-05 05:23:13 +04:00
Dmitry Marakasov
5542acd252 Add tests for RWops 2014-09-05 04:54:53 +04:00