chromium/third_party/flatbuffers/src/tests/parser_test.cpp

#include "parser_test.h"

#include <cmath>
#include <limits>
#include <string>

#include "flatbuffers/idl.h"
#include "test_assert.h"

namespace flatbuffers {
namespace tests {
namespace {

// Shortcuts for the infinity.
static const auto infinity_f =;
static const auto infinity_d =;

// Test that parser errors are actually generated.
static void TestError_(const char *src, const char *error_substr,
                       bool strict_json, const char *file, int line,
                       const char *func) {}

static void TestError_(const char *src, const char *error_substr,
                       const char *file, int line, const char *func) {}

#ifdef _WIN32
#define TestError
#else
#define TestError(src, ...)
#endif

static bool FloatCompare(float a, float b) {}

}  // namespace

// Test that parsing errors occur as we'd expect.
// Also useful for coverage, making sure these paths are run.
void ErrorTest() {}

void EnumOutOfRangeTest() {}

void IntegerOutOfRangeTest() {}

void InvalidFloatTest() {}

void UnicodeInvalidSurrogatesTest() {}

void InvalidUTF8Test() {}

template<typename T>
T TestValue(const char *json, const char *type_name,
            const char *decls = nullptr) {}

// Additional parser testing not covered elsewhere.
void ValueTest() {}

void NestedListTest() {}

void EnumStringsTest() {}

void EnumValueTest() {}

void IntegerBoundaryTest() {}

void ValidFloatTest() {}

void UnicodeTest() {}

void UnicodeTestAllowNonUTF8() {}

void UnicodeTestGenerateTextFailsOnNonUTF8() {}

void UnicodeSurrogatesTest() {}

void UnknownFieldsTest() {}

void ParseUnionTest() {}

void ValidSameNameDifferentNamespaceTest() {}

void WarningsAsErrorsTest() {}

void StringVectorDefaultsTest() {}

void FieldIdentifierTest() {}

}  // namespace tests
}  // namespace flatbuffers