Commit Graph

1224 Commits

Author SHA1 Message Date
Campbell Barton 90f75b8ce0 Cleanup: use static sets where possible 2014-09-18 17:45:31 +10:00
Campbell Barton 0e0e528ea4 Cleanup: pep8 2014-09-17 18:36:17 +10:00
Campbell Barton 7d9760d962 Text3d: assert for <0 len text
also add operator to test blacklist
2014-09-10 23:12:11 +10:00
Bastien Montagne e44c49d89d Py Mathutils: add `invert_safe()` and `inverted_safe()` to `Matrix`.
Those two mimic our BLI invert_m4_m4_safe - they add a small offset to diagonal values,
in case org matrix is degenerated, and if still non-invertible, return identity matrix.

Org patch by me, final enhanced version by ideasman42, many thanks!
2014-09-06 14:58:38 +02:00
Campbell Barton 7ef925752c Tests: remove support.run_unittest 2014-08-21 19:56:21 +10:00
Bastien Montagne 8535b9bd15 Fix T38722: Adding units in Imperial setting results in inconsistent values
Now always check for a default unit, and evaluate the whole expression in this "unit space".
Not an ideal solution, but should handle most cases nicely
(we can't address all possible corner cases anyway).

Note default unit is searched in current string first (bigger unit of current system wins),
then in previous string.

Note this also replaces ',' by '+' in default separation between units,
helps solving issues with parenthesis (e.g. (1'1")*2.5 would fail in existing code)!
This would break if someone uses py ops with lower precedence than '+' (like bitwise
operations, and comparison), but these are not expected usecase here anyway.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D340
2014-08-20 12:12:03 +02:00
Campbell Barton 1528e5c20a Run unittest.main() directly 2014-08-11 15:23:00 +10:00
Nicholas Bishop 1c8ac33970 Fix incorrect comments in listbase, add unit test to verify change
Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D708
2014-08-05 10:33:24 -04:00
Campbell Barton 200dd87de1 Cleanup: pep8 & redundant vars 2014-07-22 12:03:15 +10:00
Campbell Barton f7d6749e2f Cleanup: test naming 2014-07-19 20:02:14 +10:00
Campbell Barton 4cc93123c8 Add thousands separators to scene stats (D646)
by januz with own modifications
2014-07-17 14:54:12 +10:00
Campbell Barton 5c4180d898 BLI_stack: various small additions
- add BLI_stack_count
- add BLI_stack_pop_n to pop into an array
- add BLI_stack_push_r, which returns a pointer that can be filled in

Also remove sanity check in BLI_stack_pop, assert if the stack is empty.
2014-07-15 21:09:03 +10:00
Campbell Barton ea1f1fe0c2 BLI_string, dont pass unicode to ascii BLI_str_partition functions 2014-07-08 06:06:34 +10:00
Bastien Montagne e3c8cf0a9e Add (r)partition funcs to BLI_string, to get left-most/right-most first occurence of delimiters.
Inspired by Python (r)partition str functions. Also added some Gtest cases for those new funcs.

Reviewed by Campbell Barton, many thanks!
2014-07-04 14:14:06 +02:00
Campbell Barton 228361973d Add BLI_stack test 2014-06-30 11:55:01 +10:00
Campbell Barton 8df6769040 CMake: update source files 2014-06-28 23:17:11 +10:00
Campbell Barton 489937e1e7 GTest now works without buildinfo 2014-06-23 01:16:49 +10:00
Howard Trickey eaac6cbcd9 Add a bmesh_core_test, a start at testing bmesh functionality.
Needed to make the blender link libraries a global property
now that tests are parallel to source directory.
Current sort order for blender link libraries doesn't work
for tests that start with few defined symbols. Doubling the
lib list works, but a TODO to find a better way (probably
using CMake's own mechanism for tracking dependencies).
2014-06-19 11:53:55 -04:00
Campbell Barton 7ecc3f4734 Add brief license headers to tests
These are effectively public-domain, but use apache2.0 to avoid adding new licenses
2014-06-19 18:48:41 +10:00
Sergey Sharybin a6e58cd761 Use Blender codestyle, not Google's one! 2014-06-19 12:47:56 +06:00
Sergey Sharybin 16d64a99b4 Add unit tests for aligned alloc
This was really handy on initial work of aligned alloc
and would be handy as well when we'll need to support
arbitrary alignment on Apple platforms.
2014-06-19 12:45:00 +06:00
Sergey Sharybin 72b607ab74 Some WITH_TESTS weer not renamed to WITH_GTEST 2014-06-18 22:28:27 +06:00
Sergey Sharybin 306cbb82ec GTest unit testing framework
Currently covers only small set of functionality.
2014-06-19 02:09:16 +10:00
Campbell Barton 0eb060c7b4 Move tests into tests/ top-level dir 2014-06-18 22:03:46 +10:00