apply the C++11 style change in .clang-format

This commit is contained in:
Billy Donahue
2019-01-18 03:46:57 -05:00
committed by Hans Johnson
parent 756a08fbbd
commit 2b593a9da8
9 changed files with 67 additions and 62 deletions

View File

@@ -166,7 +166,8 @@ void TestResult::printFailure(bool printTestName) const {
}
}
Json::String TestResult::indentText(const Json::String& text, const Json::String& indent) {
Json::String TestResult::indentText(const Json::String& text,
const Json::String& indent) {
Json::String reindented;
Json::String::size_type lastIndex = 0;
while (lastIndex < text.size()) {
@@ -405,7 +406,9 @@ void Runner::printUsage(const char* appName) {
// Assertion functions
// //////////////////////////////////////////////////////////////////
Json::String ToJsonString(const char* toConvert) { return Json::String(toConvert); }
Json::String ToJsonString(const char* toConvert) {
return Json::String(toConvert);
}
Json::String ToJsonString(Json::String in) { return in; }

View File

@@ -60,7 +60,7 @@ public:
/// Not encapsulated to prevent step into when debugging failed assertions
/// Incremented by one on assertion predicate entry, decreased by one
/// by addPredicateContext().
PredicateContext::Id predicateId_{ 1 };
PredicateContext::Id predicateId_{1};
/// \internal Implementation detail for predicate macros
PredicateContext* predicateStackTail_;
@@ -102,15 +102,16 @@ private:
unsigned int line,
const char* expr,
unsigned int nestingLevel);
static Json::String indentText(const Json::String& text, const Json::String& indent);
static Json::String indentText(const Json::String& text,
const Json::String& indent);
typedef std::deque<Failure> Failures;
Failures failures_;
Json::String name_;
PredicateContext rootPredicateNode_;
PredicateContext::Id lastUsedPredicateId_{ 0 };
PredicateContext::Id lastUsedPredicateId_{0};
/// Failure which is the target of the messages added using operator <<
Failure* messageTarget_{ nullptr };
Failure* messageTarget_{nullptr};
};
class TestCase {
@@ -124,7 +125,7 @@ public:
virtual const char* testName() const = 0;
protected:
TestResult* result_{ nullptr };
TestResult* result_{nullptr};
private:
virtual void runTestCase() = 0;
@@ -218,8 +219,7 @@ TestResult& checkStringEqual(TestResult& result,
#define JSONTEST_ASSERT_PRED(expr) \
{ \
JsonTest::PredicateContext _minitest_Context = { \
result_->predicateId_, __FILE__, __LINE__, #expr, NULL, NULL \
}; \
result_->predicateId_, __FILE__, __LINE__, #expr, NULL, NULL}; \
result_->predicateStackTail_->next_ = &_minitest_Context; \
result_->predicateId_ += 1; \
result_->predicateStackTail_ = &_minitest_Context; \

View File

@@ -82,19 +82,19 @@ struct ValueTest : JsonTest::TestCase {
/// Initialize all checks to \c false by default.
IsCheck();
bool isObject_{ false };
bool isArray_{ false };
bool isBool_{ false };
bool isString_{ false };
bool isNull_{ false };
bool isObject_{false};
bool isArray_{false};
bool isBool_{false};
bool isString_{false};
bool isNull_{false};
bool isInt_{ false };
bool isInt64_{ false };
bool isUInt_{ false };
bool isUInt64_{ false };
bool isIntegral_{ false };
bool isDouble_{ false };
bool isNumeric_{ false };
bool isInt_{false};
bool isInt64_{false};
bool isUInt_{false};
bool isUInt64_{false};
bool isIntegral_{false};
bool isDouble_{false};
bool isNumeric_{false};
};
void checkConstMemberCount(const Json::Value& value,
@@ -120,10 +120,11 @@ Json::String ValueTest::normalizeFloatingPointStr(const Json::String& s) {
(s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
Json::String::size_type exponentStartIndex = index + 1 + hasSign;
Json::String normalized = s.substr(0, exponentStartIndex);
Json::String::size_type indexDigit = s.find_first_not_of('0', exponentStartIndex);
Json::String::size_type indexDigit =
s.find_first_not_of('0', exponentStartIndex);
Json::String exponent = "0";
if (indexDigit != Json::String::npos) // There is an exponent different
// from 0
// from 0
{
exponent = s.substr(indexDigit);
}
@@ -2353,22 +2354,22 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) {
Json::String in;
};
const TestData test_data[] = {
{ __LINE__, true, "{\"a\":9}" }, //
{ __LINE__, false, "{\"a\":0Infinity}" }, //
{ __LINE__, false, "{\"a\":1Infinity}" }, //
{ __LINE__, false, "{\"a\":9Infinity}" }, //
{ __LINE__, false, "{\"a\":0nfinity}" }, //
{ __LINE__, false, "{\"a\":1nfinity}" }, //
{ __LINE__, false, "{\"a\":9nfinity}" }, //
{ __LINE__, false, "{\"a\":nfinity}" }, //
{ __LINE__, false, "{\"a\":.nfinity}" }, //
{ __LINE__, false, "{\"a\":9nfinity}" }, //
{ __LINE__, false, "{\"a\":-nfinity}" }, //
{ __LINE__, true, "{\"a\":Infinity}" }, //
{ __LINE__, false, "{\"a\":.Infinity}" }, //
{ __LINE__, false, "{\"a\":_Infinity}" }, //
{ __LINE__, false, "{\"a\":_nfinity}" }, //
{ __LINE__, true, "{\"a\":-Infinity}" } //
{__LINE__, true, "{\"a\":9}"}, //
{__LINE__, false, "{\"a\":0Infinity}"}, //
{__LINE__, false, "{\"a\":1Infinity}"}, //
{__LINE__, false, "{\"a\":9Infinity}"}, //
{__LINE__, false, "{\"a\":0nfinity}"}, //
{__LINE__, false, "{\"a\":1nfinity}"}, //
{__LINE__, false, "{\"a\":9nfinity}"}, //
{__LINE__, false, "{\"a\":nfinity}"}, //
{__LINE__, false, "{\"a\":.nfinity}"}, //
{__LINE__, false, "{\"a\":9nfinity}"}, //
{__LINE__, false, "{\"a\":-nfinity}"}, //
{__LINE__, true, "{\"a\":Infinity}"}, //
{__LINE__, false, "{\"a\":.Infinity}"}, //
{__LINE__, false, "{\"a\":_Infinity}"}, //
{__LINE__, false, "{\"a\":_nfinity}"}, //
{__LINE__, true, "{\"a\":-Infinity}"} //
};
for (const auto& td : test_data) {
bool ok = reader->parse(&*td.in.begin(), &*td.in.begin() + td.in.size(),