aboutsummaryrefslogtreecommitdiff
path: root/crypto/bio
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2023-04-17 17:27:49 -0400
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-17 21:49:06 +0000
commitc466222febf86ef8e12c7926d5544354c905fce5 (patch)
tree12f3a0795c47b7afef216330e4a6b8bf048d4ecf /crypto/bio
parent6e1e367021faafc74647427cdc1605a4844c2f83 (diff)
downloadboringssl-c466222febf86ef8e12c7926d5544354c905fce5.zip
boringssl-c466222febf86ef8e12c7926d5544354c905fce5.tar.gz
boringssl-c466222febf86ef8e12c7926d5544354c905fce5.tar.bz2
Skip some BIO_gets tests if tmpfile fails on Android
On Android, when running from an APK, |tmpfile| does not work. See b/36991167#comment8. Change-Id: I1415471907e61da5e8c8d1530a2b915fcd991d53 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/58845 Auto-Submit: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: Bob Beck <bbe@google.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bio_test.cc11
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()));