* typified a bit of map.h/cpp + some dependents
* Macro crasher found by one compiler!
* demanded changes
* stupid wokaround for demanded changes
* Sort out conflict mess
* Convert integer parsing test to use normal TEST_CASEs
* Rename test name too similar to another
* Test to enforce normalized test names
* Normalize TEST_CASE names (scripted)
Our string_id constants were a mixture of temporaries, locals, and
globals. Pull them all out as globals, for consistency and efficiency.
The efficiency comes from the fact that each string_id instance caches
its respective int_id, and sharing one instance means that value need
not be recomputed.
Catch2 provides a customization point for converting our types to
strings by specializing the StringMaker template.
We have some specializations in stringmaker.h, but this feature was only
working intermittently. I finally figured out that was due to an ODR
violation. The test files that didn't include stringmaker.h were
compiling a different specialization than the ones that did.
Re-jig the test includes so that any file including catch.hpp also
includes stringmaker.h, thereby ensuring that the custom
specializations are used everywhere and there is no ODR violation.
I achieved this by adding a new cata_catch.h header and making all
existing headers include catch.hpp via the new header.
* Use <= instead of < in one field test
The radioactive field test is repeatedly failing due to the test being
for less-than instead of less-than-or-equal (300 vs 300 turns). Due to
test logs not being searchable on either Github or Travis, I am not
able to locate some past cases I have seen, but I can locate
https://travis-ci.org/github/CleverRaven/Cataclysm-DDA/jobs/763202025
and
https://github.com/CleverRaven/Cataclysm-DDA/pull/48119/checks?check_run_id=2143797637.
(I am grateful to wapcaplet for the PR enabling actually seeing what
the numbers were.)
* Remove 2 unneeded changes.
I had been thinking of making all of the less-than turns into
less-than-or-equal turns, but decided against it. Some edits were left
over; this commit removes them.
Co-authored-by: actual-nh <actual-nh@users.noreply.github.com>
Using CHECK with a time_duration yields unhelpful messages like:
CHECK( fields_test_duration() < time_limit )
{?} < {?}
Converting the compared values to an integer number of turns allows the
messages (for both success and failure) to be more intelligible, like:
CHECK( fields_test_turns() < time_limit_turns )
113 < 3600 (0xe10)
* added param `alive_only` to `field::find_field` methods. By default "removed" fields are not returned
* all field-related methods in `map` treat fields with zero intensity as non-existing
* Change _ctype.h and __locale to cctype and clocale
* Change _wctype.h to cwctype in game.cpp
* Change __functional_base to functional
* Remove libcxx internal headers
* Remove UNIX system headers
* Fix clang-tidy error with -nostdinc++
* Exclude fire from exponential decay
* Add a scaling factor of log2(e), experimentally determined.
* Add some basic tests for exiry time of fields
* Apply suggestions from code review
Co-authored-by: Curtis Merrill <curtis.r.merrill@gmail.com>
* Apply suggestions from code review
* Add M_LOG2E to math defines
Co-authored-by: Zhilkin Serg <ZhilkinSerg@users.noreply.github.com>
Co-authored-by: Curtis Merrill <curtis.r.merrill@gmail.com>