summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2015-12-14 14:35:17 +0000
committer Calin Juravle <calin@google.com> 2015-12-14 14:35:17 +0000
commitef885cdfa8e3c61a67750110c1efcdd2559af1ec (patch)
treec6e8e4315fde240f1f071935776371f56602fe14
parent66278646b5b332142d1474703ac7d945dfbf7c78 (diff)
Print more info on why the code_cache test fails in 115-native-bridge.
Change-Id: Ib30893e53a5ed616ae4f6b6bc4d657b0fca846c8
-rw-r--r--test/115-native-bridge/nativebridge.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/115-native-bridge/nativebridge.cc b/test/115-native-bridge/nativebridge.cc
index e9946c885c..b70ca4ff3e 100644
--- a/test/115-native-bridge/nativebridge.cc
+++ b/test/115-native-bridge/nativebridge.cc
@@ -267,11 +267,20 @@ extern "C" bool native_bridge_initialize(const android::NativeBridgeRuntimeCallb
const char* app_code_cache_dir,
const char* isa ATTRIBUTE_UNUSED) {
struct stat st;
- if ((app_code_cache_dir != nullptr)
- && (stat(app_code_cache_dir, &st) == 0)
- && S_ISDIR(st.st_mode)) {
- printf("Code cache exists: '%s'.\n", app_code_cache_dir);
+ if (app_code_cache_dir != nullptr) {
+ if (stat(app_code_cache_dir, &st) == 0) {
+ if (S_ISDIR(st.st_mode)) {
+ printf("Code cache exists: '%s'.\n", app_code_cache_dir);
+ } else {
+ printf("Code cache is not a directory.\n");
+ }
+ } else {
+ perror("Error when stat-ing the code_cache:");
+ }
+ } else {
+ printf("app_code_cache_dir is null.\n");
}
+
if (art_cbs != nullptr) {
gNativeBridgeArtCallbacks = art_cbs;
printf("Native bridge initialized.\n");