#![allow(unsafe_code)]
#![allow(dead_code)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::items_after_statements)]
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::missing_const_for_fn)]
use cuengine::CStringPtr;
use std::ffi::CString;
fn requires_send<T: Send>(_t: T) {}
fn requires_sync<T: Sync>(_t: &T) {}
fn assert_not_send<T: Send>() {}
fn assert_not_sync<T: Sync>() {}
#[test]
fn test_cstring_ptr_not_send() {
let test_string = CString::new("test").unwrap();
let ptr = test_string.into_raw();
let cstring_ptr = unsafe { CStringPtr::new(ptr) };
drop(cstring_ptr);
}
#[test]
fn test_cstring_ptr_not_sync() {
let test_string = CString::new("test").unwrap();
let ptr = test_string.into_raw();
let cstring_ptr = unsafe { CStringPtr::new(ptr) };
drop(cstring_ptr);
}
#[test]
fn test_thread_safety_markers() {
let test_string = CString::new("test").unwrap();
let ptr = test_string.into_raw();
let cstring_ptr = unsafe { CStringPtr::new(ptr) };
assert!(!cstring_ptr.is_null());
let _result = unsafe { cstring_ptr.to_str().unwrap() };
}