#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "base/json/json_reader.h"
#include <stddef.h>
#include <cmath>
#include <string_view>
#include <utility>
#include "base/base_paths.h"
#include "base/features.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/rust_buildflags.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/gmock_expected_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
std::string_view MakeNotNullTerminatedInput(const char* input,
std::unique_ptr<char[]>* owner) { … }
}
namespace base {
class JSONReaderTest : public testing::TestWithParam<bool> { … };
TEST_P(JSONReaderTest, Whitespace) { … }
TEST_P(JSONReaderTest, InvalidString) { … }
TEST_P(JSONReaderTest, SimpleBool) { … }
TEST_P(JSONReaderTest, EmbeddedComments) { … }
TEST_P(JSONReaderTest, Ints) { … }
TEST_P(JSONReaderTest, NonDecimalNumbers) { … }
TEST_P(JSONReaderTest, NumberZero) { … }
TEST_P(JSONReaderTest, LargeIntPromotion) { … }
TEST_P(JSONReaderTest, LargerIntIsLossy) { … }
TEST_P(JSONReaderTest, Doubles) { … }
TEST_P(JSONReaderTest, FractionalNumbers) { … }
TEST_P(JSONReaderTest, ExponentialNumbers) { … }
TEST_P(JSONReaderTest, InvalidInfNAN) { … }
TEST_P(JSONReaderTest, InvalidNumbers) { … }
TEST_P(JSONReaderTest, Zeroes) { … }
TEST_P(JSONReaderTest, SimpleString) { … }
TEST_P(JSONReaderTest, EmptyString) { … }
TEST_P(JSONReaderTest, BasicStringEscapes) { … }
TEST_P(JSONReaderTest, UnicodeEscapes) { … }
TEST_P(JSONReaderTest, InvalidStrings) { … }
TEST_P(JSONReaderTest, BasicArray) { … }
TEST_P(JSONReaderTest, EmptyArray) { … }
TEST_P(JSONReaderTest, CompleteArray) { … }
TEST_P(JSONReaderTest, NestedArrays) { … }
TEST_P(JSONReaderTest, InvalidArrays) { … }
TEST_P(JSONReaderTest, ArrayTrailingComma) { … }
TEST_P(JSONReaderTest, ArrayTrailingCommaNoEmptyElements) { … }
TEST_P(JSONReaderTest, EmptyDictionary) { … }
TEST_P(JSONReaderTest, CompleteDictionary) { … }
TEST_P(JSONReaderTest, NestedDictionaries) { … }
TEST_P(JSONReaderTest, DictionaryKeysWithPeriods) { … }
TEST_P(JSONReaderTest, DuplicateKeys) { … }
TEST_P(JSONReaderTest, InvalidDictionaries) { … }
TEST_P(JSONReaderTest, StackOverflow) { … }
TEST_P(JSONReaderTest, UTF8Input) { … }
TEST_P(JSONReaderTest, InvalidUTF8Input) { … }
TEST_P(JSONReaderTest, UTF16Escapes) { … }
TEST_P(JSONReaderTest, InvalidUTF16Escapes) { … }
TEST_P(JSONReaderTest, LiteralRoots) { … }
TEST_P(JSONReaderTest, ReadFromFile) { … }
TEST_P(JSONReaderTest, StringOptimizations) { … }
TEST_P(JSONReaderTest, InvalidSanity) { … }
TEST_P(JSONReaderTest, IllegalTrailingNull) { … }
TEST_P(JSONReaderTest, ASCIIControlCodes) { … }
TEST_P(JSONReaderTest, MaxNesting) { … }
TEST_P(JSONReaderTest, Decode4ByteUtf8Char) { … }
TEST_P(JSONReaderTest, DecodeUnicodeNonCharacter) { … }
TEST_P(JSONReaderTest, DecodeNegativeEscapeSequence) { … }
TEST_P(JSONReaderTest, ReplaceInvalidCharacters) { … }
TEST_P(JSONReaderTest, ReplaceInvalidUTF16EscapeSequence) { … }
TEST_P(JSONReaderTest, ParseNumberErrors) { … }
TEST_P(JSONReaderTest, UnterminatedInputs) { … }
TEST_P(JSONReaderTest, LineColumnCounting) { … }
TEST_P(JSONReaderTest, ChromiumExtensions) { … }
TEST_P(JSONReaderTest, UnescapedControls) { … }
TEST_P(JSONReaderTest, UsingRust) { … }
INSTANTIATE_TEST_SUITE_P(…);
}