Commit Graph

478 Commits

Author SHA1 Message Date
9aa0ba8f55 test: use constexpr for test data where possible 2017-08-27 12:28:56 +10:00
3c9dcba2fb coord/ops: add rshift coord operation
shifts each element to the right `num' places and fills the left space
with a constant or elements from another vector.
2017-08-25 13:05:45 +10:00
e9ef2ae316 sarray: add assignment operator for completeness in test 2017-08-24 17:53:46 +10:00
56444b4a50 geom/aabb: add (minimally) more thorough test data 2017-08-24 17:02:18 +10:00
1cea1600d3 geom/aabb: change contract/expand semantics to mirror region 2017-08-24 17:01:16 +10:00
f77cdabaee geom/aabb: dont use mutating function naming convention 2017-08-24 16:47:02 +10:00
cd1bb730f2 geom/aabb: rename AABB to aabb 2017-08-24 16:43:54 +10:00
359702fb86 geom/aabb: remove mutating operators 2017-08-24 16:25:57 +10:00
6e32ad84a7 coord: use consistent naming for point coverage tests
use inclusive for tests that include all borders, and exclusive for
tests that do not accept the bottom right borders.
2017-08-24 15:56:58 +10:00
efb719b822 coord/base: add indices method 2017-08-24 14:39:54 +10:00
84963aacf8 coord/ops: make 'all' and 'any' constexpr 2017-08-24 14:39:54 +10:00
14718594c9 coord: add tests for vec/num/num overload of util::limit 2017-08-24 12:50:17 +10:00
2576061b26 ray: extract make member function as free function
for consistency with other make_foo functions. to be replaced with
deduction guides in the future.
2017-08-22 15:46:49 +10:00
a016e98b12 region: add make_range for regions
introduces an object that provides iterators suitable for row-major
scanning of points covering a region object. mostly a wrapper for the
equivalent extent_range.
2017-08-21 18:48:52 +10:00
31d2e6bfd8 region: remove duplicate point/region coverage tests 2017-08-11 15:15:44 +10:00
01f6e5a1e8 region: add make_union function 2017-07-31 15:44:01 +10:00
0016c83dab coord: add the select function 2017-07-31 15:41:57 +10:00
f39f7d7362 parse: add throwing native type parsers 2017-07-26 15:26:56 +10:00
d29276a427 region: add "has" point query 2017-07-25 17:10:16 +10:00
b18feb8bc4 maths: use bit patterns for tests float values
this makes some of the tests more robust in the face of (potentially
stanard breaking) optimisations.
2017-07-25 17:08:52 +10:00
a27869d1c8 region: commenting and style for test cases 2017-07-19 17:19:20 +10:00
3460d5edbe crypto/salsa: add initial skeleton for salsa20 2017-07-11 16:49:49 +10:00
320fe6c378 job/queue: add trivial job queuing system 2017-07-03 17:05:01 +10:00
96c80ecea5 comparator: add test for self equality failure 2017-06-29 15:27:16 +10:00
6065aa9933 comparator: add comparator for indexed compound types
compares each index of the two parameters in sequence, returning true if
the first parameter has the first value that compares less than the
second.
2017-06-19 15:28:10 +10:00
046a369f55 coord: don't use kahan summation for sum(coord)
Our kahan summation algorithm has issues with infinities so we just
avoid using it in coordinates where speed and simplicity are more
important.
2017-06-16 17:38:55 +10:00
061088467f coord: add structured bindings support 2017-06-15 16:32:40 +10:00
ca63485d12 sarray: add a simple static storage/dynamic size array 2017-06-14 17:45:43 +10:00
b15914cf9a iterator: add make_indices, zip, and izip 2017-06-13 17:01:06 +10:00
2bc7e3e449 point: work around GCC ICE in test case
GCC experiences an ICE when comparing the components of a redim'd to
lower dimension point. The test case is too complex to reasonably reduce
and submit for fixing/workaround so we add a bit more explicit work here
for this test case only.
2017-06-13 14:19:27 +10:00
606a46a128 typeidx: add lightweight runtime type id call 2017-05-29 17:21:11 +10:00
da00e77e7e maths: add signed overloads for renormalise 2017-05-24 15:15:25 +10:00
30fa4a378d colour: add html-style colour parsing 2017-05-22 16:20:21 +10:00
813600e774 ascii: add hex conversion and unit tests 2017-05-22 16:11:31 +10:00
9471b9eae7 test: ensure all tests return a useful status code
These tests were all assumed to execute correctly because CTest is not
capable of parsing the TAP output and instead relies entirely on status
codes.
2017-05-22 13:55:21 +10:00
1ad3e0bde0 algo/sort: add SOA sorting helper
sort::soa applies a permutation to multiple value arrays such that the
first value array is sorted
2017-05-18 18:24:48 +10:00
436df2952f view: add make_view specialisations for std::string 2017-03-17 18:06:02 +11:00
bec24535fc hash/crc: parameterise crc for reflection, and 64 bits 2017-02-14 19:47:12 +11:00
5a25f07f8e hash/crc: adapt implementation from png appendix 2017-01-25 16:12:12 +11:00
ca7f4b739a exe: test image query against argv, not constants 2017-01-25 15:07:14 +11:00
845c8dd14d cmake: avoid recursive cmake lists for tests 2017-01-25 15:06:47 +11:00
d937bb2ece backtrace: convert from CRLF terminators to LF 2017-01-23 15:33:47 +11:00
dd23d4a347 build: cmake tests 2017-01-17 19:20:30 +11:00
c0f3983ca8 stream: add minimal scoped flag test case 2017-01-09 15:54:47 +11:00
98dc992473 build: avoid integer length warnings 2017-01-05 19:50:28 +11:00
b770e5f370 fixed: add integer logical operators 2017-01-04 22:38:41 +11:00
2e0fa64494 range: convert static members to constexpr methods 2016-12-21 16:44:48 +11:00
2dcb315ce6 region: prefer constexpr functions over static variables 2016-12-12 17:07:53 +11:00
4bf160934c vector: prefer constexpr functions over static variables 2016-12-12 17:04:39 +11:00
d2ba672a30 colour: remove static constants 2016-12-12 17:03:36 +11:00
6d079554a6 format: fix escaped percent before value specifier 2016-12-06 13:37:54 +11:00
cb32823248 hash: add xxhash implementation 2016-11-17 18:38:09 +11:00
246357e279 random: remove typed randomisers without generators 2016-11-17 18:38:08 +11:00
a93dd90da9 types: remove elems function, prefer std::size
Now that std::size is part of our supported compilers we can remove the
old elems function.
2016-11-17 18:06:39 +11:00
e549f3d554 matrix: move identity and zeroes into constexpr funcs 2016-10-17 22:34:53 +11:00
e96ef7af32 quaternion: move out of coord infrastructure 2016-10-17 22:30:16 +11:00
9cff1e9c85 test/affine: add trivial origin rotation test 2016-10-17 16:51:06 +11:00
1d53c32de0 quaternion: add trivial from_to tests 2016-10-12 23:03:33 +11:00
db076ad6f4 quaternion: update look, from_to, rotate 2016-10-12 23:03:33 +11:00
1af6ed4ca8 matrix: fix look_at multiply ordering 2016-10-12 23:03:33 +11:00
9a798446b5 build: remove unnecessary includes
discovered with include-what-you-use
2016-10-12 15:08:22 +11:00
2d31cf9537 matrix: add tranposition test case 2016-10-11 20:57:03 +11:00
3dc31a9d10 alloc/aligned: add allocator with forced alignment 2016-10-10 18:19:09 +11:00
254a63ca90 exe: split into platform units 2016-10-10 16:23:07 +11:00
fad44bd1f7 format: allow %! specifier for all types
If we allow the %! specifier for all types it greatly simplifies
handling of format strings in templated code, or code with non-trivial
typedefs.
2016-09-27 15:23:33 +10:00
ede9b75bad vector: fix hypot implementation 2016-09-21 22:24:02 +10:00
4544a594c3 vector: add hypot function
calculates the root of the sum of the squares. much like std::hypot, but
of arbitrary dimension.
2016-09-21 17:13:25 +10:00
d9713fe8b7 json/tree: fix signed min, unsigned max constraints
signed/unsigned casting issues prevented correct comparisons with the
min/max constraints. account for the source type's range before doing the
comparison.
2016-09-20 16:02:08 +10:00
e2b4e48315 test: add matrix/quaternion consistency checks 2016-09-14 17:56:27 +10:00
83484a6ea1 matrix: add look_at and euler tests 2016-09-14 17:56:27 +10:00
c917f264c4 quaternion: fix incorrect factorisation in as_matrix
One of the terms in m[0][0] and m[1][1] was incorrectly negated from an
incomplete factorisation when I transcribed the formula.

Also reintroduces the axis-rotation tests which inadvertantly had zero
magnitudes.
2016-09-14 16:49:26 +10:00
45795a1ae0 quaternion: compare test results using sum-of-differences
comparison of floating point values is inexact and there isn't an easy
way for providing an ULP delta via the TAP interface. morever, the
general expected error is too large to reliably express in ULPs.
2016-08-15 20:56:10 +10:00
28cd180c44 matrix: add expanded scalar operations 2016-08-15 20:56:10 +10:00
f6ceb5cdee coord/ops: add element sum overload 2016-08-15 20:56:10 +10:00
1f86925237 matrix: add elementwise sum function overload 2016-08-15 20:56:10 +10:00
b809925396 vector: rename UNIT to ONES
unit isn't a normalised vector, so it's misleading to call it a 'unit'
vector
2016-08-15 20:56:10 +10:00
606a9c4eb8 coord/ops: use free functions for normalisations 2016-08-11 14:58:46 +10:00
974998cc48 quaternion: update to use coord framework 2016-08-10 17:42:52 +10:00
de48f75e96 format: fix transcription of zero values to strings
an iteration condition terminated the write when a value was zero rather
than when all numerals were written. instead, iterate over the remaining
numerals.

fixes printf("%zu", 0u)
2016-08-10 17:38:39 +10:00
c26c687912 format: set ostream precision as if for strings
ostream conversions are converted to strings anyway, so we should treat
them as such earlier in the process.
2016-07-28 16:13:23 +10:00
fad8181842 format: allow undersize integers for conversion 2016-07-28 16:13:23 +10:00
a40e09ed97 format: write c_str as %s by default, support c_str as %p 2016-07-28 14:18:47 +10:00
70170f4205 alloc/arena: disallow implicit copy constructor in test obj
fixes a build warning under clang
2016-07-28 13:39:27 +10:00
8cc4c1e82a format: reimplement format rendering
requires literal string arrays, and implements more of the specifier
specification. does not implement 'n' or '$' specifiers. falls back to
snprintf for real arguments.
2016-07-28 13:39:27 +10:00
f9fb0873d3 build: tidy system headers 2016-07-28 13:39:27 +10:00
f793175fdf json/schema: add 'integer' type support 2016-07-04 15:46:01 +10:00
2e700e6444 rand: add mwc64x generator 2016-06-30 18:20:57 +10:00
3b82757e5c test/random: use a constant seed 2016-06-30 15:26:45 +10:00
642317f6a4 json: use templated iterator for parsing from views 2016-06-28 14:16:28 +10:00
a87e03de34 hash: move tests to hash directory 2016-06-24 13:08:19 +10:00
350dd96b2d alloc: add base and offset methods 2016-06-22 19:51:18 +10:00
08536765b6 Merge branch 'crypto' 2016-06-20 18:08:46 +10:00
8d191fb2e1 hash/keccak: add initial sha3 base 2016-06-20 18:05:30 +10:00
a0d02c2fdb crypto/ice: add implementation of ICE 2016-06-20 18:04:41 +10:00
8333cad8cc WIP checksum test api 2016-06-20 16:53:56 +10:00
4b01f999c4 version: add comparator tests 2016-06-20 13:08:36 +10:00
f88958d17d WIP checksum namespacing 2016-06-17 15:57:36 +10:00
c3e2e1ae44 exe: add trivial test case 2016-05-13 15:23:05 +10:00
950c5ba0d4 ip: avoid temporary in test 2016-05-12 18:00:12 +10:00
829bdc2767 m/b/paged: annotate segv trigger for asan's benefit 2016-05-12 17:59:33 +10:00
e7c547f764 tuple: note why RTTI test was skipped 2016-05-12 17:59:08 +10:00
27b1bfc1ce hmac: print test number in logs 2016-05-12 17:58:52 +10:00
420e4215ef backtrace: test doesn't actually require output 2016-05-12 17:44:44 +10:00
8142944139 json: store numbers natively as uint/sint/real
allows more accurate representations and better error checking.
2016-05-12 17:41:31 +10:00
e17158b0bb build: add forgotten cxx headers
discovered testing clang 3.8 under freebsd
2016-05-12 17:31:33 +10:00
b814c83e21 test/json: run tests through a line wine/crlf wrapper
unit tests rely on AWKs record seperator being LF which presents issues
when running windows tests. rather than modify the tap-driver provided
by autotools (which would be extremely annoying to maintain) we run all
tests through wine-crlf.sh which will perform line ending transforms as
required.

it's a pretty braindead script, so don't do anything terrifically
extreme under it.
2016-04-27 17:13:36 +10:00
df9d0ce432 format: add invalid_specifier exception 2016-04-27 16:12:24 +10:00
9bbcfa6e63 make header paths more explicit 2016-04-05 11:06:35 +10:00
eacd2f6072 string: allow cstring tokenisers 2016-03-18 11:08:12 +11:00
6a1ea8ff29 string: add tokeniser 2016-03-17 18:14:40 +11:00
28d44593d8 view: add make_view, ref-qualifiers, comparators 2016-03-17 18:14:40 +11:00
f13c4487c6 cmdopt: add positional argument support 2016-03-15 13:56:13 +11:00
9e9477858b coord: add trivial operation tests 2016-03-14 22:32:52 +11:00
a59844be98 don't pull in namespace std 2016-03-11 13:28:56 +11:00
379e652e83 build: update for standalone pkgconfig deployment 2016-02-24 11:55:08 +11:00
817eb50efc image: move buffer into image directory 2016-02-19 13:56:12 +11:00
bbc06efa24 alloc/dynamic: add virtual allocator interface 2016-02-10 14:05:09 +11:00
d81b9f12fd pool: rename remain as size for consistency 2016-02-04 12:41:23 +11:00
5a3165d233 roots/bisection: add bisection root finder 2016-02-03 13:57:18 +11:00
c8afad1e5b rand/lcg: add naive LCG RNG 2016-02-03 12:13:03 +11:00
9248c2f379 format: test invalid specifier with unused specifier
we are using '!' as a specifier now, so don't test invalid specifiers
with this value...
2016-02-03 12:02:56 +11:00
f6fa44f54f random: rename test from rand to random 2016-02-02 11:32:04 +11:00
0fd72f0893 format: test case whitespace 2016-01-20 16:39:20 +11:00
c877192cfc format: add test case for char[] 2016-01-20 16:38:54 +11:00
d9a0649acb test: convert remaining tests to TAP 2016-01-19 18:31:49 +11:00
d232f1c871 alloc: rename 'size' to 'used' 2015-11-30 16:08:07 +11:00
ffe219748a alloc/arena: add simple test cases 2015-11-24 16:52:47 +11:00
4556745d77 memory/deleter: add trivial test case 2015-11-19 16:46:44 +11:00
99d025af4d strongdef: actually use tagging for disambiguation... 2015-11-19 15:06:52 +11:00
38678cc78e strongdef: add specialisation of numeric_limits 2015-11-18 14:46:43 +11:00
4599b11197 strongdef: add trivial instantiation test 2015-11-18 14:44:08 +11:00
791f8b2bcd maths: remove rootsquare, use std::hypot instead 2015-11-16 13:18:29 +11:00
b1bc54ac8c maths: move remaining operations into util namespace 2015-11-16 11:44:07 +11:00
1ec9582240 alloc: add initial allocator stubs 2015-11-13 17:18:10 +11:00
7b083df977 maths: tighten up type requirements for almost_equal
almost_equal only operates on two reals, or two integers (and even then
only on the same signedness).
2015-11-13 17:18:10 +11:00
32ca27abdf memory: add paged and circular buffers 2015-11-11 16:56:35 +11:00
a73fb9307c matrix: extract size dependant operations 2015-11-04 23:23:46 +11:00
176b33604b matrix: parameterise on dimension 2015-10-30 23:40:13 +11:00
fe7e3e9c6f test/maths: remove debug print statement 2015-10-29 18:23:07 +11:00
003685ce2b image: templatise on component count 2015-10-20 16:54:15 +11:00
c2770a266b maths: split normalise functions 2015-10-20 16:54:15 +11:00
b5929b7b4a image: remove access to w/h/s members 2015-10-19 17:43:48 +11:00
20bafa2cfb geom: move geometry primitives to own namespace 2015-10-13 18:19:47 +11:00
0283c6b0f9 build: disable rtti for release builds 2015-10-08 12:20:56 +11:00
2653a8ecee maths/fast: remove, it's broken 2015-09-29 17:42:20 +10:00
464c703ffd extent: add range-for adapter for extent points 2015-09-29 17:32:11 +10:00
b58dd7a880 extent: fix double negative for contraction 2015-09-22 17:23:54 +10:00
37f9390ef8 view: template on arbirtrary iterator types 2015-09-21 15:36:05 +10:00
ec42319224 coord: test for proper packing 2015-09-21 15:27:36 +10:00
9445b29bd3 test/json_types: use new style parse signature 2015-09-09 18:45:23 +10:00
08b6cbacea float: lower ULPs threshold for almost_equal
we weren't detecting differences with 4 decimal point differences
2015-08-20 15:34:20 +10:00
eb155d5bb0 m/fast: add some fast maths approximations 2015-07-29 16:11:48 +10:00
86b36afc49 image: add simple offset test 2015-07-23 21:19:15 +10:00
785a9e08f6 tap: remove default format strings 2015-07-21 03:17:20 +10:00
3b97f56ead polynomial: rename solve as roots 2015-07-21 02:59:14 +10:00
74d7f9c717 vector: add {to,from}_euler 2015-07-21 02:56:37 +10:00
7396057508 vector: use TAP in tests 2015-07-21 02:55:11 +10:00
f451e5555e format: add trivial printf wrapper 2015-07-21 01:37:45 +10:00
abf88710b4 test: use TAP on more tests 2015-07-13 16:30:54 +10:00
8840bae7b0 rational: update with more operators 2015-07-13 16:30:54 +10:00
991558fc7f build: remove unused options code 2015-07-02 17:25:04 +10:00
536284a56d cmdopt: add TAP testing 2015-07-02 17:03:56 +10:00
75af292340 cmdopt: transfer test cases from option tests 2015-06-30 22:24:44 +10:00
e8d3cf8eb1 maths: remove deprecated maths objects 2015-06-05 16:07:03 +10:00
fd319d579b build: make single argument constructors explicit 2015-06-04 22:18:43 +10:00
9b548e56d9 point: convert distance member functions to functions 2015-06-01 15:29:24 +10:00
3a4fed804a fasthash: add initial implementation 2015-05-28 12:17:25 +10:00
a61ea32228 murmurhash: add initial translation 2015-05-25 16:12:45 +10:00
054dfa918e crypto: add XXTEA {en,de}cryption. 2015-05-15 18:27:24 +10:00
7f0c7466e4 crypto: encrypt in-place where it suits 2015-05-15 18:26:45 +10:00
ddaca2f453 XTEA: add extended TEA encryption 2015-05-07 00:18:01 +10:00
dd05d677dd TEA: use static sized storage for tests 2015-05-07 00:17:20 +10:00
9d3c058873 TEA: add "Tiny Encryption Algorithm" 2015-05-06 23:49:45 +10:00
717644acde arc4: add initial implementation 2015-05-06 21:38:56 +10:00
70c65c2bb2 introspection: map tuples to themselves in type_tuple 2015-05-01 02:49:19 +10:00
358f2ddb60 tuple: test tuple mapping with template src types
Added complexity in the test to help diagnose issues with the
introspection code.
2015-05-01 02:43:27 +10:00
7bc96bd60f maths: explicitly instantiate PI for float, double 2015-05-01 02:42:32 +10:00
bb1e87bb47 options: don't import util and std namespaces 2015-04-30 21:03:18 +10:00
c052d7df4b maths: use templated PI and E constants 2015-04-29 17:45:39 +10:00
33401becbd tuple: add type mapping template 2015-04-21 14:21:01 +10:00
199be3213a introspection: add simple static introspection types 2015-04-20 17:51:00 +10:00
fa8387252e tuple: add tuple iteration helpers 2015-04-20 17:48:11 +10:00
e939cca6fd ray: return NaN for negative aabb intersection 2015-04-15 14:20:59 +10:00
ffaf10de21 extent: silence unused variable warning in test 2015-04-15 14:06:30 +10:00
6f1278767f vector: add is_normalised 2015-04-15 13:52:37 +10:00
8863ebafe9 ray: add ray-sphere intersection test 2015-04-13 21:47:51 +10:00
7e2baf6751 ray: convert test to TAP format 2015-04-13 21:47:37 +10:00
7ae57730f0 whitespace 2015-04-13 18:06:08 +10:00
bbbbb675a6 test: move tests to TAP output 2015-04-13 16:45:56 +10:00
e9c0ed3f5f tap: use an object for logging 2015-04-13 16:43:49 +10:00
a7f96a127d colour: add hsv/rgb conversions 2015-04-09 21:50:42 +10:00
7307d73bbc colour: add html and x11 string lookup 2015-04-09 20:46:55 +10:00
ef4475949d colour: specialise the cast function 2015-04-09 20:46:24 +10:00
bd88832df3 coord: move cast/redim operations to coord 2015-04-09 17:58:47 +10:00
9f6c17d6cf maths: add renormalise function 2015-04-09 17:44:50 +10:00
afad51db9d aabb: add expand call 2015-04-09 14:05:01 +10:00
a300f99b87 vector: add polar_to_cartesian 2015-04-02 15:01:17 +11:00
5674f2a2e9 json: add basic json-schema draft 4 support 2015-03-19 00:25:50 +11:00
4e3d67185c rename line to ray 2015-03-11 22:31:35 +11:00
daa492ce07 signal: add return value combiners 2015-03-10 22:52:38 +11:00