summaryrefslogtreecommitdiffstats
path: root/liblog/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-02-05 17:50:35 -0800
committerElliott Hughes <enh@google.com>2014-02-05 18:02:11 -0800
commit5d9fe779c8ec2705865a23061834ad8cdbee5b82 (patch)
tree92b5a9331b64f97c3201fa0798f57daa10d6fd17 /liblog/tests
parenteaba2bedf529eeb21351c8bf6365107cb6a4e8b6 (diff)
downloadsystem_core-5d9fe779c8ec2705865a23061834ad8cdbee5b82.zip
system_core-5d9fe779c8ec2705865a23061834ad8cdbee5b82.tar.gz
system_core-5d9fe779c8ec2705865a23061834ad8cdbee5b82.tar.bz2
system/core LP64 cleanup.
Fixes -Wint-to-pointer and -Wpointer-to-int warnings, plus various -Wformat warnings. Change-Id: I6c5eea6b4273d82d28b8e5d2925f3e5457511b17
Diffstat (limited to 'liblog/tests')
-rw-r--r--liblog/tests/benchmark_main.cpp5
-rw-r--r--liblog/tests/liblog_test.cpp10
2 files changed, 9 insertions, 6 deletions
diff --git a/liblog/tests/benchmark_main.cpp b/liblog/tests/benchmark_main.cpp
index 02df460..090394c 100644
--- a/liblog/tests/benchmark_main.cpp
+++ b/liblog/tests/benchmark_main.cpp
@@ -16,6 +16,7 @@
#include <benchmark.h>
+#include <inttypes.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
@@ -158,10 +159,10 @@ void Run(Benchmark* b) {
sdev = (sqrt((double)nXvariance) / gBenchmarkNum / gBenchmarkNum) + 0.5;
}
if (mean > (10000 * sdev)) {
- printf("%-25s %10llu %10llu%s\n", full_name,
+ printf("%-25s %10" PRIu64 " %10" PRIu64 "%s\n", full_name,
static_cast<uint64_t>(iterations), mean, throughput);
} else {
- printf("%-25s %10llu %10llu(\317\203%llu)%s\n", full_name,
+ printf("%-25s %10" PRIu64 " %10" PRIu64 "(\317\203%" PRIu64 ")%s\n", full_name,
static_cast<uint64_t>(iterations), mean, sdev, throughput);
}
fflush(stdout);
diff --git a/liblog/tests/liblog_test.cpp b/liblog/tests/liblog_test.cpp
index 9ae8f22..d71d97a 100644
--- a/liblog/tests/liblog_test.cpp
+++ b/liblog/tests/liblog_test.cpp
@@ -15,6 +15,7 @@
*/
#include <fcntl.h>
+#include <inttypes.h>
#include <signal.h>
#include <gtest/gtest.h>
#include <log/log.h>
@@ -85,8 +86,8 @@ TEST(liblog, __android_log_btwrite) {
static void* ConcurrentPrintFn(void *arg) {
int ret = __android_log_buf_print(LOG_ID_MAIN, ANDROID_LOG_INFO,
- "TEST__android_log_print", "Concurrent %d",
- reinterpret_cast<int>(arg));
+ "TEST__android_log_print", "Concurrent %" PRIuPTR,
+ reinterpret_cast<uintptr_t>(arg));
return reinterpret_cast<void*>(ret);
}
@@ -106,8 +107,9 @@ TEST(liblog, concurrent_name(__android_log_buf_print, NUM_CONCURRENT)) {
for (i=0; i < NUM_CONCURRENT; i++) {
void* result;
ASSERT_EQ(0, pthread_join(t[i], &result));
- if ((0 == ret) && (0 != reinterpret_cast<int>(result))) {
- ret = reinterpret_cast<int>(result);
+ int this_result = reinterpret_cast<uintptr_t>(result);
+ if ((0 == ret) && (0 != this_result)) {
+ ret = this_result;
}
}
ASSERT_LT(0, ret);