tidy up after merge from master

This commit is contained in:
Steve Hanson 2022-11-25 14:21:45 +00:00 committed by Milo Yip
parent 794248ee62
commit 7cad78e236
10 changed files with 39 additions and 40 deletions

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
if(POLICY CMP0025) if(POLICY CMP0025)
# detect Apple's Clang # detect Apple's Clang
cmake_policy(SET CMP0025 NEW) cmake_policy(SET CMP0025 NEW)

Binary file not shown.

View File

@ -41,7 +41,8 @@ static std::string GetString(const ValueType& val) {
s << "false"; s << "false";
else if (val.IsFloat()) else if (val.IsFloat())
s << val.GetFloat(); s << val.GetFloat();
return s.str();} return s.str();
}
// Create the error message for a named error // Create the error message for a named error
// The error object can either be empty or contain at least member properties: // The error object can either be empty or contain at least member properties:

View File

@ -72,7 +72,7 @@ public:
typedef GenericUri<ValueType, Allocator> UriType; typedef GenericUri<ValueType, Allocator> UriType;
//! A token is the basic units of internal representation. //! A token is the basic units of internal representation.
/*! /*!
A JSON pointer string representation "/foo/123" is parsed to two tokens: A JSON pointer string representation "/foo/123" is parsed to two tokens:
"foo" and 123. 123 will be represented in both numeric form and string form. "foo" and 123. 123 will be represented in both numeric form and string form.

View File

@ -195,7 +195,7 @@
*/ */
#ifndef RAPIDJSON_NO_INT64DEFINE #ifndef RAPIDJSON_NO_INT64DEFINE
//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN //!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013 #if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013
#include "msinttypes/stdint.h" #include "msinttypes/stdint.h"
#include "msinttypes/inttypes.h" #include "msinttypes/inttypes.h"
#else #else

View File

@ -50,10 +50,6 @@
#define RAPIDJSON_SCHEMA_VERBOSE 0 #define RAPIDJSON_SCHEMA_VERBOSE 0
#endif #endif
#if RAPIDJSON_SCHEMA_VERBOSE
#include "stringbuffer.h"
#endif
RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PUSH
#if defined(__GNUC__) #if defined(__GNUC__)
@ -1309,6 +1305,8 @@ private:
else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType); else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType);
} }
// Creates parallel validators for allOf, anyOf, oneOf, not and schema dependencies, if required.
// Also creates a hasher for enums and array uniqueness, if required.
bool CreateParallelValidator(Context& context) const { bool CreateParallelValidator(Context& context) const {
if (enum_ || context.arrayUniqueness) if (enum_ || context.arrayUniqueness)
context.hasher = context.factory.CreateHasher(); context.hasher = context.factory.CreateHasher();

View File

@ -77,7 +77,7 @@ static void TestFileStream() {
} }
fp = fopen(filename, "r"); fp = fopen(filename, "r");
ASSERT_TRUE( fp != NULL ); ASSERT_TRUE( fp != NULL );
for (const char* p = s; *p; p++) for (const char* p = s; *p; p++)
EXPECT_EQ(*p, static_cast<char>(fgetc(fp))); EXPECT_EQ(*p, static_cast<char>(fgetc(fp)));
fclose(fp); fclose(fp);

View File

@ -191,7 +191,7 @@ TEST(Uri, Parse_UTF16) {
#if RAPIDJSON_HAS_STDSTRING #if RAPIDJSON_HAS_STDSTRING
typedef std::basic_string<Value16::Ch> String; typedef std::basic_string<Value16::Ch> String;
String str = L"http://auth/path/xxx?query#frag"; String str = L"http://auth/path/xxx?query#frag";
const UriType uri = UriType(str); const UriType uri = UriType(str, &allocator);
EXPECT_TRUE(UriType::GetScheme(uri) == L"http:"); EXPECT_TRUE(UriType::GetScheme(uri) == L"http:");
EXPECT_TRUE(UriType::GetAuth(uri) == L"//auth"); EXPECT_TRUE(UriType::GetAuth(uri) == L"//auth");
EXPECT_TRUE(UriType::GetPath(uri) == L"/path/xxx"); EXPECT_TRUE(UriType::GetPath(uri) == L"/path/xxx");

View File

@ -1717,17 +1717,17 @@ static void TestShortStringOptimization(const char* str) {
rapidjson::Value val; rapidjson::Value val;
val.SetString(str, len, doc.GetAllocator()); val.SetString(str, len, doc.GetAllocator());
EXPECT_EQ(val.GetStringLength(), len); EXPECT_EQ(val.GetStringLength(), len);
EXPECT_STREQ(val.GetString(), str); EXPECT_STREQ(val.GetString(), str);
} }
TEST(Value, AllocateShortString) { TEST(Value, AllocateShortString) {
TestShortStringOptimization(""); // edge case: empty string TestShortStringOptimization(""); // edge case: empty string
TestShortStringOptimization("12345678"); // regular case for short strings: 8 chars TestShortStringOptimization("12345678"); // regular case for short strings: 8 chars
TestShortStringOptimization("12345678901"); // edge case: 11 chars in 32-bit mode (=> short string) TestShortStringOptimization("12345678901"); // edge case: 11 chars in 32-bit mode (=> short string)
TestShortStringOptimization("123456789012"); // edge case: 12 chars in 32-bit mode (=> regular string) TestShortStringOptimization("123456789012"); // edge case: 12 chars in 32-bit mode (=> regular string)
TestShortStringOptimization("123456789012345"); // edge case: 15 chars in 64-bit mode (=> short string) TestShortStringOptimization("123456789012345"); // edge case: 15 chars in 64-bit mode (=> short string)
TestShortStringOptimization("1234567890123456"); // edge case: 16 chars in 64-bit mode (=> regular string) TestShortStringOptimization("1234567890123456"); // edge case: 16 chars in 64-bit mode (=> regular string)
} }
template <int e> template <int e>