Jaak Ristioja 4a6bcc706e
Use nullptr/NULL instead of 0 for pointers, two fixes for undefined behavior
This commit fixes most -Wzero-as-null-pointer-constant warnings, except in
some places which appear to be vendored 3rd party libraries, e.g. in sdl_ttf.c,
libchdr, physfs and gmock and in 3rd party components therein. Since it might
make more sense to update this 3rd party code to some later versions instead of
fixing the warnings manually, I decided not to enable the C++ compiler flag in
configure.ac at this point.

In two functions with the return type of std::string executed `return 0;`
statements, causing std::string to be constructed from a null pointer. To avoid
undefined behavior these were changed to `return {};`.

Signed-off-by: Jaak Ristioja <jaak@ristioja.ee>
2024-05-09 14:18:10 +03:00
..
2021-11-23 07:05:51 -05:00
2024-02-28 19:08:20 -08:00
2022-04-16 16:01:23 -04:00
2021-11-23 22:40:59 -05:00
2022-01-15 20:48:54 -05:00
2024-02-28 19:08:20 -08:00

Source files in this subdirectory contain unit tests.
They use gTest and gMock for running unit testing.
Unit tests can be launched with "dosbox-x -tests".
Free free to add more unit tests in this directory.

Read Google Test Primer for reference of most available
features, macros, and guidance about writing unit tests:

https://google.github.io/googletest/primer.html

More information about gMock can be found at:

https://google.github.io/googletest/gmock_for_dummies.html