aboutsummaryrefslogtreecommitdiff
path: root/src/unittest
Commit message (Collapse)AuthorAge
* Clean up threadingShadowNinja2015-08-23
| | | | | | | | | | | | | | | | | | | | * Rename everything. * Strip J prefix. * Change UpperCamelCase functions to lowerCamelCase. * Remove global (!) semaphore count mutex on OSX. * Remove semaphore count getter (unused, unsafe, depended on internal API functions on Windows, and used a hack on OSX). * Add `Atomic<type>`. * Make `Thread` handle thread names. * Add support for C++11 multi-threading. * Combine pthread and win32 sources. * Remove `ThreadStarted` (unused, unneeded). * Move some includes from the headers to the sources. * Move all of `Event` into its header (allows inlining with no new includes). * Make `Event` use `Semaphore` (except on Windows). * Move some porting functions into `Thread`. * Integrate logging with `Thread`. * Add threading test.
* Remove unused functions.onkrot2015-08-16
|
* Fix Lua PcgRandomest312015-08-12
| | | | | | | | | | | | | | | | Before, this lua code led to a crash: local pcg = PcgRandom(42) local value = pcg:next() This was because if you called s32 PcgRandom::range(min, max) with the minimum and maximum possible values for s32 integers (which the lua binding code did), u32 PcgRandom::range(bound) got called with 0 as the bound. The bound however is one above the maximum value, so 0 is a "special" value to pass to this function. This commit fixes the lua crash by assigning the RNG's full range to the bound 0, which is also fits to the "maximum is bound - 1" principle, as (u32)-1 is the maximum value in the u32 range.
* Improve accuracy and safety of float serializationkwolekr2015-08-01
| | | | | | | | | Multiplying by a factor of 1/1000.f (rather than dividing by 1000.f) directly introduces an error of 1 ULP. With this patch, an exact comparison of a floating point literal with the deserialized F1000 form representing it is now guaranteed to be successful. In addition, the maxmium and minimum safely representible floating point numbers are now well-defined as constants.
* Clean up util/serialization.{cpp,h} and add unit testskwolekr2015-08-01
|
* tests: Log exceptions thrown inside of unit testskwolekr2015-07-31
|
* Add AreaStore data structureest312015-07-27
|
* Add more robust error checking to deSerialize*String routineskwolekr2015-07-13
| | | | | Add serializeHexString() Clean up util/serialize.cpp
* Use UTF-8 instead of narrowest312015-07-08
| | | | | Use wide_to_utf8 and utf8_to_wide instead of wide_to_narrow and narrow_to_wide at almost all places. Only exceptions: test functions for narrow conversion, and chat, which is done in a separate commit.
* Fix wrap_rows at inner byte of multibyte sequencefigec2015-06-18
| | | | Also fix UTF-8 inner byte bounds and make unittest for case this fixes.
* Make wrap_rows not wrap inside utf-8 multibyte sequencesest312015-06-17
| | | | | | Also count multibyte sequences as "one" character. Adds unittest for the bug reporter's case. Fixes #2796.
* Add UTF and other utility unit testsest312015-06-14
|
* Split ObjDef/ObjDefManager out to objdef.cppkwolekr2015-05-18
|
* Add -Wsign-compare for Clang builds and fix some signed/unsigned compiler ↵kwolekr2015-05-16
| | | | warnings
* Schematics: Add per-node force placement optionkwolekr2015-05-09
|
* Fix compilation for non-client builds, and fix signed comparison warningkwolekr2015-05-08
|
* Tests: Add schematic unittestskwolekr2015-05-08
| | | | | Improve schematic file-saving interface Add ability to create temporary test files
* NodeResolver: Remove NodeResolveMethodkwolekr2015-05-07
| | | | This simplifies NodeResolver logic and makes some interfaces cleaner.
* Fix build on Debian broken by b45df9d (missing include, somehow?)kwolekr2015-05-05
|
* NodeDefManager: Improve const-correctness of interfaceskwolekr2015-05-05
| | | | | | - Add ability to explicitly reset NodeResolve state (useful for unittesting) - Remove non-essential NodeResolve methods modifying state from INodeDefManager - Add const qualifier to NodeDefManager and ContentFeatures serialize
* Tests: Add NodeResolver unittestskwolekr2015-05-05
| | | | | | Minor misc. NodeResolver cleanups Prefix faux content type constants for testing with t_ to avoid confusion or name collisions
* Fix GCC compiler warningShadowNinja2015-05-04
|
* Tests: Add ObjDef unittestskwolekr2015-05-03
|
* Fix several MSVC issues numeric.hSmallJoker2015-05-01
| | | | | -> Round negative numbers correctly CMakeLists.txt -> Link Json with the static run-time library
* Fix MSVC compatibilitykwolekr2015-04-29
| | | | | | Make sure to include random unittests in android builds, too Use SWAP() macro Ensure that negative ranges are tested as well in random unittests
* Tests: Add random unittestskwolekr2015-04-29
|
* Tests: Modularize unit testingkwolekr2015-04-26
Split unit tests into separate files under src/unittest/ Give better unittest diagnostics Clean up some code