* 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)
* Event based items: add new field "event"
- Added new field "event" to item group entries
- If defined, use event to determine probability
- Migrate get_holiday_from_time to cata_utility.cpp
* Add menu option to enable/disable event-based spawns
* Document event-based item spawns
* Add unit test & fix spawn logic
I love unit tests!
The test revealed some logic flaws that I've fixed to make
event-based item spawns work properly.
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.
* 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++
itype_id is (presumably) one of the oldest type ids in the game. In
particular, it predates string_id, and was simply a typedef of
std::string.
This is bad for type safety.
Make it be a string_id specialization instead, and update the rest of
the code accordingly.