aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-12-03 21:59:16 -0500
committerJack Lloyd <[email protected]>2018-12-03 21:59:16 -0500
commit10dd757c2b98e4239d7780b3620b5e39ed938ea3 (patch)
tree70e0658cef36094aa418d10f13c93e336fab45f9 /src/tests
parent25c2a2d84efa1a9e1f17ecc2713f0acd0992a26f (diff)
Fix a FFI test when threads are disabled
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_ffi.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tests/test_ffi.cpp b/src/tests/test_ffi.cpp
index 50c85eff6..fddc9874d 100644
--- a/src/tests/test_ffi.cpp
+++ b/src/tests/test_ffi.cpp
@@ -209,7 +209,15 @@ class FFI_Unit_Tests final : public Test
std::vector<uint8_t> outbuf(512);
- if(TEST_FFI_OK(botan_rng_init, (&rng, "user-threadsafe")))
+ rc = botan_rng_init(&rng, "user-threadsafe");
+ result.confirm("Either success or not implemented", rc == 0 || rc == BOTAN_FFI_ERROR_NOT_IMPLEMENTED);
+
+ if(rc != 0)
+ {
+ REQUIRE_FFI_OK(botan_rng_init, (&rng, "user"));
+ }
+
+ if(rc == 0)
{
TEST_FFI_OK(botan_rng_get, (rng, outbuf.data(), outbuf.size()));
TEST_FFI_OK(botan_rng_reseed, (rng, 256));