From 761a6a36acd808a5f68ced6724e9cc99891c6c43 Mon Sep 17 00:00:00 2001 From: Ziyan Date: Wed, 28 Mar 2018 17:16:51 +0900 Subject: [PATCH 1/3] Remove gtest. --- .gitmodules | 3 --- thirdparty/gtest | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 thirdparty/gtest diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5e41f7c97..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "thirdparty/gtest"] - path = thirdparty/gtest - url = https://github.com/google/googletest.git diff --git a/thirdparty/gtest b/thirdparty/gtest deleted file mode 160000 index 0a439623f..000000000 --- a/thirdparty/gtest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0a439623f75c029912728d80cb7f1b8b48739ca4 From 71c66c0e220b0fab91570c4d20f73c83d88581e0 Mon Sep 17 00:00:00 2001 From: Ross Schlaikjer Date: Wed, 23 Oct 2024 10:25:12 +0900 Subject: [PATCH 2/3] Allow assertions with message, log member name when missing --- include/rapidjson/document.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 094a07e82..47154a711 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1108,7 +1108,15 @@ class GenericValue { if (member != MemberEnd()) return member->value; else { - RAPIDJSON_ASSERT(false); // see above note +#ifdef RAPIDJSON_ASSERT_MSG + static const char* const ASSERT_MESSAGE = "cannot find member %s"; + const size_t assertBufferSize = strlen(ASSERT_MESSAGE) + name.GetStringLength() + 1; + char assertBuffer[assertBufferSize]; + snprintf(assertBuffer, assertBufferSize, ASSERT_MESSAGE, name.GetString()); + RAPIDJSON_ASSERT_MSG(false, assertBuffer); // see above note +#else + RAPIDJSON_ASSERT(false); // see above note +#endif // This will generate -Wexit-time-destructors in clang // static GenericValue NullValue; From b7a31a532f2a576588d011f29da7f1249033fbd8 Mon Sep 17 00:00:00 2001 From: Ross Schlaikjer Date: Thu, 24 Oct 2024 11:01:46 +0900 Subject: [PATCH 3/3] quote key --- include/rapidjson/document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 47154a711..ae769a129 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1109,7 +1109,7 @@ class GenericValue { return member->value; else { #ifdef RAPIDJSON_ASSERT_MSG - static const char* const ASSERT_MESSAGE = "cannot find member %s"; + static const char* const ASSERT_MESSAGE = "cannot find member '%s'"; const size_t assertBufferSize = strlen(ASSERT_MESSAGE) + name.GetStringLength() + 1; char assertBuffer[assertBufferSize]; snprintf(assertBuffer, assertBufferSize, ASSERT_MESSAGE, name.GetString());