aboutsummaryrefslogtreecommitdiff
path: root/src/unittest
AgeCommit message (Collapse)Author
2015-10-26Remove some abort() callsest31
abort() doesn't benefit from the high level abstractions from FATAL_ERROR.
2015-10-24Fix some threading things and add additional thread unittestskwolekr
- Fix thread name reset on start() - Fully reset thread state on kill() - Add unittests to check for correct object states under various circumstances
2015-10-15Add BufReader and vector-based serialization methodskwolekr
2015-10-14Rename macros with two leading underscoresShadowNinja
These names are reserved for the compiler/library implementations.
2015-10-14Refactor loggingShadowNinja
- Add warning log level - Change debug_log_level setting to enumeration string - Map Irrlicht log events to MT log events - Encapsulate log_* functions and global variables into a class, Logger - Unify dstream with standard logging mechanism - Unify core.debug() with standard core.log() script API
2015-10-04Define and use limit constants for Irrlicht fixed-width typeskwolekr
2015-08-23Clean up threadingShadowNinja
* 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.
2015-08-16Remove unused functions.onkrot
2015-08-12Fix Lua PcgRandomest31
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.
2015-08-01Improve accuracy and safety of float serializationkwolekr
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.
2015-08-01Clean up util/serialization.{cpp,h} and add unit testskwolekr
2015-07-31tests: Log exceptions thrown inside of unit testskwolekr
2015-07-27Add AreaStore data structureest31
2015-07-13Add more robust error checking to deSerialize*String routineskwolekr
Add serializeHexString() Clean up util/serialize.cpp
2015-07-08Use UTF-8 instead of narrowest31
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.
2015-06-18Fix wrap_rows at inner byte of multibyte sequencefigec
Also fix UTF-8 inner byte bounds and make unittest for case this fixes.
2015-06-17Make wrap_rows not wrap inside utf-8 multibyte sequencesest31
Also count multibyte sequences as "one" character. Adds unittest for the bug reporter's case. Fixes #2796.
2015-06-14Add UTF and other utility unit testsest31
2015-05-18Split ObjDef/ObjDefManager out to objdef.cppkwolekr
2015-05-16Add -Wsign-compare for Clang builds and fix some signed/unsigned compiler ↵kwolekr
warnings
2015-05-09Schematics: Add per-node force placement optionkwolekr
2015-05-08Fix compilation for non-client builds, and fix signed comparison warningkwolekr
2015-05-08Tests: Add schematic unittestskwolekr
Improve schematic file-saving interface Add ability to create temporary test files
2015-05-07NodeResolver: Remove NodeResolveMethodkwolekr
This simplifies NodeResolver logic and makes some interfaces cleaner.
2015-05-05Fix build on Debian broken by b45df9d (missing include, somehow?)kwolekr
2015-05-05NodeDefManager: Improve const-correctness of interfaceskwolekr
- 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
2015-05-05Tests: Add NodeResolver unittestskwolekr
Minor misc. NodeResolver cleanups Prefix faux content type constants for testing with t_ to avoid confusion or name collisions
2015-05-04Fix GCC compiler warningShadowNinja
2015-05-03Tests: Add ObjDef unittestskwolekr
2015-05-01Fix several MSVC issues numeric.hSmallJoker
-> Round negative numbers correctly CMakeLists.txt -> Link Json with the static run-time library
2015-04-29Fix MSVC compatibilitykwolekr
Make sure to include random unittests in android builds, too Use SWAP() macro Ensure that negative ranges are tested as well in random unittests
2015-04-29Tests: Add random unittestskwolekr
2015-04-26Tests: Modularize unit testingkwolekr
Split unit tests into separate files under src/unittest/ Give better unittest diagnostics Clean up some code