diff options
| -rw-r--r-- | test/115-native-bridge/nativebridge.cc | 17 |
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"); |