Commit 86245ce9 authored by Milo Yip's avatar Milo Yip

Remove cppformat and strtk

parent 0dbcc1cf
......@@ -25,30 +25,6 @@
#define __STDC_FORMAT_MACROS
#include "rapidjson/stringbuffer.h"
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable: 4996)
#endif
#define strtk_no_tr1_or_boost
#include "strtk/strtk.hpp"
#ifdef _MSC_VER
#pragma warning (pop)
#endif
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable: 4245; disable: 4512; disable: 4996)
#endif
#include "cppformat/format.h"
#include "cppformat/format.cc"
#ifdef _MSC_VER
#pragma warning (pop)
#endif
#define protected public
#include "rapidjson/writer.h"
#undef private
......@@ -1001,107 +977,4 @@ TEST_F(Misc, itoa64_Writer2_InsituStringStream) { itoa64_Writer_InsituStringStre
TEST_F(Misc, itoa64_Writer3_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer3<rapidjson::InsituStringStream> >(); }
TEST_F(Misc, itoa64_Writer4_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer4<rapidjson::InsituStringStream> >(); }
TEST_F(Misc, itoa_sprintf) {
size_t length = 0;
for (size_t i = 0; i < kItoaTrialCount; i++) {
for (size_t j = 0; j < randvalCount; j++) {
char buffer[32];
length += sprintf(buffer, "%d", randval[j]);
}
}
OUTPUT_LENGTH(length);
}
TEST_F(Misc, itoa64_sprintf) {
size_t length = 0;
for (size_t i = 0; i < kItoaTrialCount; i++) {
for (size_t j = 0; j < randvalCount; j++) {
char buffer[32];
int64_t x = randval[j] * randval[j];
length += sprintf(buffer, "%" PRIi64, x);
}
}
OUTPUT_LENGTH(length);
}
#ifdef _MSC_VER
TEST_F(Misc, itoa_VC) {
size_t length = 0;
for (size_t i = 0; i < kItoaTrialCount; i++) {
for (size_t j = 0; j < randvalCount; j++) {
char buffer[32];
_itoa(randval[j], buffer, 10);
length += strlen(buffer);
}
}
OUTPUT_LENGTH(length);
}
TEST_F(Misc, itoa64_VC) {
size_t length = 0;
for (size_t i = 0; i < kItoaTrialCount; i++) {
for (size_t j = 0; j < randvalCount; j++) {
char buffer[32];
_i64toa(randval[j] * randval[j], buffer, 10);
length += strlen(buffer);
}
}
OUTPUT_LENGTH(length);
}
#endif
TEST_F(Misc, itoa_strtk) {
size_t length = 0;
std::string s;
s.reserve(32);
for (size_t i = 0; i < kItoaTrialCount; i++) {
for (size_t j = 0; j < randvalCount; j++) {
s = strtk::type_to_string(randval[j]);
length += s.size();
}
}
OUTPUT_LENGTH(length);
}
TEST_F(Misc, itoa64_strtk) {
size_t length = 0;
std::string s;
s.reserve(32);
for (size_t i = 0; i < kItoaTrialCount; i++) {
for (size_t j = 0; j < randvalCount; j++) {
int64_t x = randval[j] * randval[j];
s = strtk::type_to_string(x);
length += s.size();
}
}
OUTPUT_LENGTH(length);
}
TEST_F(Misc, itoa_cppformat) {
size_t length = 0;
char buffer[32];
for (size_t i = 0; i < kItoaTrialCount; i++) {
for (size_t j = 0; j < randvalCount; j++) {
char* p = buffer;
fmt::FormatDec(p, randval[j]);
length += (p - buffer);
}
}
OUTPUT_LENGTH(length);
}
TEST_F(Misc, itoa64_cppformat) {
size_t length = 0;
char buffer[32];
for (size_t i = 0; i < kItoaTrialCount; i++) {
for (size_t j = 0; j < randvalCount; j++) {
char* p = buffer;
int64_t x = randval[j] * randval[j];
fmt::FormatDec(p, x);
length += (p - buffer);
}
}
OUTPUT_LENGTH(length);
}
#endif // TEST_MISC
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment