apply the C++11 style change in .clang-format
This commit is contained in:
parent
756a08fbbd
commit
2b593a9da8
@ -177,8 +177,7 @@ template <typename T>
|
|||||||
using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY,
|
using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY,
|
||||||
SecureAllocator<T>,
|
SecureAllocator<T>,
|
||||||
std::allocator<T>>::type;
|
std::allocator<T>>::type;
|
||||||
using String =
|
using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
|
||||||
std::basic_string<char, std::char_traits<char>, Allocator<char> >;
|
|
||||||
using IStringStream = std::basic_istringstream<String::value_type,
|
using IStringStream = std::basic_istringstream<String::value_type,
|
||||||
String::traits_type,
|
String::traits_type,
|
||||||
String::allocator_type>;
|
String::allocator_type>;
|
||||||
|
@ -37,7 +37,8 @@ static Json::String normalizeFloatingPointStr(double value) {
|
|||||||
(s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
|
(s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
|
||||||
Json::String::size_type exponentStartIndex = index + 1 + hasSign;
|
Json::String::size_type exponentStartIndex = index + 1 + hasSign;
|
||||||
Json::String normalized = s.substr(0, exponentStartIndex);
|
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";
|
Json::String exponent = "0";
|
||||||
if (indexDigit != Json::String::npos) // There is an exponent different
|
if (indexDigit != Json::String::npos) // There is an exponent different
|
||||||
// from 0
|
// from 0
|
||||||
@ -180,7 +181,8 @@ static int rewriteValueTree(const Json::String& rewritePath,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Json::String removeSuffix(const Json::String& path, const Json::String& extension) {
|
static Json::String removeSuffix(const Json::String& path,
|
||||||
|
const Json::String& extension) {
|
||||||
if (extension.length() >= path.length())
|
if (extension.length() >= path.length())
|
||||||
return Json::String("");
|
return Json::String("");
|
||||||
Json::String suffix = path.substr(path.length() - extension.length());
|
Json::String suffix = path.substr(path.length() - extension.length());
|
||||||
|
@ -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 reindented;
|
||||||
Json::String::size_type lastIndex = 0;
|
Json::String::size_type lastIndex = 0;
|
||||||
while (lastIndex < text.size()) {
|
while (lastIndex < text.size()) {
|
||||||
@ -405,7 +406,9 @@ void Runner::printUsage(const char* appName) {
|
|||||||
// Assertion functions
|
// 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; }
|
Json::String ToJsonString(Json::String in) { return in; }
|
||||||
|
|
||||||
|
@ -102,7 +102,8 @@ private:
|
|||||||
unsigned int line,
|
unsigned int line,
|
||||||
const char* expr,
|
const char* expr,
|
||||||
unsigned int nestingLevel);
|
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;
|
typedef std::deque<Failure> Failures;
|
||||||
Failures failures_;
|
Failures failures_;
|
||||||
@ -218,8 +219,7 @@ TestResult& checkStringEqual(TestResult& result,
|
|||||||
#define JSONTEST_ASSERT_PRED(expr) \
|
#define JSONTEST_ASSERT_PRED(expr) \
|
||||||
{ \
|
{ \
|
||||||
JsonTest::PredicateContext _minitest_Context = { \
|
JsonTest::PredicateContext _minitest_Context = { \
|
||||||
result_->predicateId_, __FILE__, __LINE__, #expr, NULL, NULL \
|
result_->predicateId_, __FILE__, __LINE__, #expr, NULL, NULL}; \
|
||||||
}; \
|
|
||||||
result_->predicateStackTail_->next_ = &_minitest_Context; \
|
result_->predicateStackTail_->next_ = &_minitest_Context; \
|
||||||
result_->predicateId_ += 1; \
|
result_->predicateId_ += 1; \
|
||||||
result_->predicateStackTail_ = &_minitest_Context; \
|
result_->predicateStackTail_ = &_minitest_Context; \
|
||||||
|
@ -120,7 +120,8 @@ Json::String ValueTest::normalizeFloatingPointStr(const Json::String& s) {
|
|||||||
(s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
|
(s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
|
||||||
Json::String::size_type exponentStartIndex = index + 1 + hasSign;
|
Json::String::size_type exponentStartIndex = index + 1 + hasSign;
|
||||||
Json::String normalized = s.substr(0, exponentStartIndex);
|
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";
|
Json::String exponent = "0";
|
||||||
if (indexDigit != Json::String::npos) // There is an exponent different
|
if (indexDigit != Json::String::npos) // There is an exponent different
|
||||||
// from 0
|
// from 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user