diff options
Diffstat (limited to 'crypto/bio/bio_test.cc')
-rw-r--r-- | crypto/bio/bio_test.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/bio/bio_test.cc b/crypto/bio/bio_test.cc index 99cdcbf..6610be9 100644 --- a/crypto/bio/bio_test.cc +++ b/crypto/bio/bio_test.cc @@ -427,7 +427,18 @@ TEST(BIOTest, Gets) { using ScopedFILE = std::unique_ptr<FILE, decltype(&fclose)>; ScopedFILE file(tmpfile(), fclose); +#if defined(OPENSSL_ANDROID) + // On Android, when running from an APK, |tmpfile| does not work. See + // b/36991167#comment8. + if (!file) { + fprintf(stderr, "tmpfile failed: %s (%d). Skipping file-based tests.\n", + strerror(errno), errno); + continue; + } +#else ASSERT_TRUE(file); +#endif + if (!t.bio.empty()) { ASSERT_EQ(1u, fwrite(t.bio.data(), t.bio.size(), /*nitems=*/1, file.get())); |