Debian Codegraph @

crt/s2n/bindings/rust/extended/s2n-tls-sys/tests/s2n_init.rs

raw symbols SCIP
1 // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 // SPDX-License-Identifier: Apache-2.0
3
4 use s2n_tls_sys::*;
5
6 #[test]
7 fn s2n_init_test() {
8 unsafe {
9 // don't force the tests to use mlock
10 std::env::set_var("S2N_DONT_MLOCK", "1");
11
12 // try to initialize the library
13 if s2n_init() != 0 {
14 let error = *s2n_errno_location();
15 let msg = s2n_strerror_name(error);
16 let msg = std::ffi::CStr::from_ptr(msg);
17 panic!("s2n did not initialize correctly: {msg:?}");
18 }
19 }
20 }