* all GTest/GMock files moved to `test/gtest` directory
* `CMakeLists.txt` created in `test/gtest` from `CMakeLists.txt` in `test`
* GTest/GMock target in CMake renamed to `gtest` (was `gmock`)
* CMake `gtest` target updated to export includes as "gtest/gtest.h" or "gmock/gmock.h" only
* includes in tests updated: "gtest.h" -> "gtest/gtest.h", "gmock.h" -> "gmock/gmock.h"
* removed duplications of `target_include_directories` for GTest/GMock directories (CMake manages them)
Problem:
- gcc-8 gives the following error when compiling this function on all
standards:
test/std-format-test.cc: In member function 'constexpr auto std::formatter<S>::parse(std::format_parse_context&)':
test/std-format-test.cc:112:17: error: call to non-'constexpr' function 'int isdigit(int)'
if (!isdigit(c) || (++iter, get_char()) != '}')
~~~~~~~^~~
Solution:
- Write a `constexpr` version of `isdigit` for use in this function.
Co-authored-by: Jonathan Gopel <jgopel@quantlab.com>
Problem:
- On Apple clang 11.0.3 (clang-1103.0.32.62), pedantic mode compilation
generates the following error:
test/std-format-test.cc:114:22: error: implicit conversion changes
signedness: 'int' to 'size_t' (aka 'unsigned long')
[-Werror,-Wsign-conversion]
width_arg_id = c - '0';
~ ~~^~~~~
Solution:
- Use a `to_unsigned` to make the conversion explicit. This is
guaranteed to be safe due to the check before the ASCII-to-int
conversion.