scummvm/test
Colin Snover 640f6039ca COMMON: Add Span to common library
Span is roughly modelled on the GSL span<T> type, and is intended
to replace direct access to raw pointers -- especially pointers
that are passed to functions along with a separate size
parameter. It provides low-cost bounds-checked reads and writes,
as well as convenience functions for reading common values
(integers of varying endianness, strings, etc.). While similar to
MemoryReadStream in purpose, Span is superior in cases where
memory is writable, where memory is accessed randomly rather than
sequentially, or where any invalid access should be treated as an
unrecoverable error. It should also be more efficient than a
MemoryReadStream because it is implemented using CRTP, so there is
no runtime overhead from dynamic dispatch.

NamedSpan is an extension of Span which provides enhanced
debugging information when out-of-bounds memory accesses occur.
It allows programmers to name the memory span at construction time,
and it also tracks the offsets of subspans so that the absolute
byte offset of the original memory can be provided in the error
message if an out-of-bounds access occurs.

SpanOwner is similar to ScopedPtr but has awareness of the design
of Span objects, so allows the memory pointed to by the Span object
inside the SpanOwner to be freed when the SpanOwner is freed
without requiring holding a separate pointer to the start of
memory. It also provides some copy semantics, so unlike a ScopedPtr,
SpanOwners can be held by objects in movable containers like
Common::Array -- but note that because there are no move semantics
in C++98, this means that a new, complete memory copy of the
pointed-to data will be created, rather than just a new Span
pointing to the same block of memory, when a container holding a
SpanOwner expands.
2017-01-08 13:20:23 -06:00
..
audio AUDIO: Wrap around in the Timestamp constructor 2014-12-20 19:38:18 +01:00
common COMMON: Add Span to common library 2017-01-08 13:20:23 -06:00
cxxtest TEST: Use "/usr/bin/env python" as the shebang line in cxxtestgen.py 2015-01-18 14:41:16 -05:00
engines/wintermute WINTERMUTE: Try to "correctly" handle dir paths 2016-12-26 12:05:41 +01:00
cxxtest_mingw.h ALL: Resolve multiple clang warnings 2014-03-30 14:38:02 +02:00
module.mk TEST: Only build Wintermute tests when that engine is enabled 2016-12-27 12:30:24 -06:00
README JANITORIAL: Add missing NL at EOF. 2011-08-07 13:53:33 +02:00

This directory contains some unit tests for ScummVM. They are based on
CxxTest <http://cxxtest.com/>, which you can find in the cxxtest
subdirectory, including its manual.

To run the unit tests, simply use "make test".