summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Meier <roger@apache.org>2014-01-17 21:07:58 +0100
committerRoger Meier <roger@apache.org>2014-01-17 21:07:58 +0100
commit0e8148024b4bd3f50331ad5fcc7334d4aa60949b (patch)
tree96f17d9346c49d03787303738fd77f44cb114ff6 /test
parent77369a0ecd7045aec7be0226ca4843f893bbcda0 (diff)
downloadthrift-0e8148024b4bd3f50331ad5fcc7334d4aa60949b.tar.gz
THRIFT-2229 cpp:thrift failed to build on OSX 10.9 GM
fix test/cpp Patch: Roger Meier
Diffstat (limited to 'test')
-rwxr-xr-x[-rw-r--r--]test/cpp/src/TestClient.cpp22
-rwxr-xr-x[-rw-r--r--]test/cpp/src/TestServer.cpp14
2 files changed, 18 insertions, 18 deletions
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index cd78505b3..a0ada14d9 100644..100755
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -288,7 +288,7 @@ int main(int argc, char** argv) {
*/
printf("testI64(-34359738368)");
int64_t i64 = testClient.testI64(-34359738368LL);
- printf(" = %"PRId64"\n", i64);
+ printf(" = %" PRId64 "\n", i64);
if (i64 != -34359738368LL)
failCount++;
/**
@@ -311,7 +311,7 @@ int main(int argc, char** argv) {
out.i64_thing = -5;
Xtruct in;
testClient.testStruct(in, out);
- printf(" = {\"%s\", %d, %d, %"PRId64"}\n",
+ printf(" = {\"%s\", %d, %d, %" PRId64 "}\n",
in.string_thing.c_str(),
(int)in.byte_thing,
in.i32_thing,
@@ -330,7 +330,7 @@ int main(int argc, char** argv) {
Xtruct2 in2;
testClient.testNest(in2, out2);
in = in2.struct_thing;
- printf(" = {%d, {\"%s\", %d, %d, %"PRId64"}, %d}\n",
+ printf(" = {%d, {\"%s\", %d, %d, %" PRId64 "}, %d}\n",
in2.byte_thing,
in.string_thing.c_str(),
(int)in.byte_thing,
@@ -488,7 +488,7 @@ int main(int argc, char** argv) {
*/
printf("testTypedef(309858235082523)");
UserId uid = testClient.testTypedef(309858235082523LL);
- printf(" = %"PRId64"\n", uid);
+ printf(" = %" PRId64 "\n", uid);
if (uid != 309858235082523LL)
failCount++;
@@ -527,7 +527,7 @@ int main(int argc, char** argv) {
printf(" = {");
map<UserId, map<Numberz::type,Insanity> >::const_iterator i_iter;
for (i_iter = whoa.begin(); i_iter != whoa.end(); ++i_iter) {
- printf("%"PRId64" => {", i_iter->first);
+ printf("%" PRId64 " => {", i_iter->first);
map<Numberz::type,Insanity>::const_iterator i2_iter;
for (i2_iter = i_iter->second.begin();
i2_iter != i_iter->second.end();
@@ -537,7 +537,7 @@ int main(int argc, char** argv) {
map<Numberz::type, UserId>::const_iterator um;
printf("{");
for (um = userMap.begin(); um != userMap.end(); ++um) {
- printf("%d => %"PRId64", ", um->first, um->second);
+ printf("%d => %" PRId64 ", ", um->first, um->second);
}
printf("}, ");
@@ -545,7 +545,7 @@ int main(int argc, char** argv) {
vector<Xtruct>::const_iterator x;
printf("{");
for (x = xtructs.begin(); x != xtructs.end(); ++x) {
- printf("{\"%s\", %d, %d, %"PRId64"}, ",
+ printf("{\"%s\", %d, %d, %" PRId64 "}, ",
x->string_thing.c_str(),
(int)x->byte_thing,
x->i32_thing,
@@ -658,7 +658,7 @@ int main(int argc, char** argv) {
uint64_t stop = now();
uint64_t tot = stop-start;
- printf("Total time: %"PRIu64" us\n", stop-start);
+ printf("Total time: %" PRIu64 " us\n", stop-start);
time_tot += tot;
if (time_min == 0 || tot < time_min) {
@@ -676,9 +676,9 @@ int main(int argc, char** argv) {
uint64_t time_avg = time_tot / numTests;
- printf("Min time: %"PRIu64" us\n", time_min);
- printf("Max time: %"PRIu64" us\n", time_max);
- printf("Avg time: %"PRIu64" us\n", time_avg);
+ printf("Min time: %" PRIu64 " us\n", time_min);
+ printf("Max time: %" PRIu64 " us\n", time_max);
+ printf("Avg time: %" PRIu64 " us\n", time_avg);
return failCount;
}
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index adb8fd1ff..af43d72e3 100644..100755
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -85,7 +85,7 @@ class TestHandler : public ThriftTestIf {
}
int64_t testI64(const int64_t thing) {
- printf("testI64(%"PRId64")\n", thing);
+ printf("testI64(%" PRId64 ")\n", thing);
return thing;
}
@@ -95,13 +95,13 @@ class TestHandler : public ThriftTestIf {
}
void testStruct(Xtruct& out, const Xtruct &thing) {
- printf("testStruct({\"%s\", %d, %d, %"PRId64"})\n", thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing);
+ printf("testStruct({\"%s\", %d, %d, %" PRId64 "})\n", thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing);
out = thing;
}
void testNest(Xtruct2& out, const Xtruct2& nest) {
const Xtruct &thing = nest.struct_thing;
- printf("testNest({%d, {\"%s\", %d, %d, %"PRId64"}, %d})\n", (int)nest.byte_thing, thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing, nest.i32_thing);
+ printf("testNest({%d, {\"%s\", %d, %d, %" PRId64 "}, %d})\n", (int)nest.byte_thing, thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing, nest.i32_thing);
out = nest;
}
@@ -175,7 +175,7 @@ class TestHandler : public ThriftTestIf {
}
UserId testTypedef(const UserId thing) {
- printf("testTypedef(%"PRId64")\n", thing);
+ printf("testTypedef(%" PRId64 ")\n", thing);
return thing;
}
@@ -233,7 +233,7 @@ class TestHandler : public ThriftTestIf {
printf(" = {");
map<UserId, map<Numberz::type,Insanity> >::const_iterator i_iter;
for (i_iter = insane.begin(); i_iter != insane.end(); ++i_iter) {
- printf("%"PRId64" => {", i_iter->first);
+ printf("%" PRId64 " => {", i_iter->first);
map<Numberz::type,Insanity>::const_iterator i2_iter;
for (i2_iter = i_iter->second.begin();
i2_iter != i_iter->second.end();
@@ -243,7 +243,7 @@ class TestHandler : public ThriftTestIf {
map<Numberz::type, UserId>::const_iterator um;
printf("{");
for (um = userMap.begin(); um != userMap.end(); ++um) {
- printf("%d => %"PRId64", ", um->first, um->second);
+ printf("%d => %" PRId64 ", ", um->first, um->second);
}
printf("}, ");
@@ -251,7 +251,7 @@ class TestHandler : public ThriftTestIf {
vector<Xtruct>::const_iterator x;
printf("{");
for (x = xtructs.begin(); x != xtructs.end(); ++x) {
- printf("{\"%s\", %d, %d, %"PRId64"}, ", x->string_thing.c_str(), (int)x->byte_thing, x->i32_thing, x->i64_thing);
+ printf("{\"%s\", %d, %d, %" PRId64 "}, ", x->string_thing.c_str(), (int)x->byte_thing, x->i32_thing, x->i64_thing);
}
printf("}");