26 lines
589 B
Rust
Raw Normal View History

mod general;
2022-09-21 16:06:27 +02:00
#[cfg(test)]
mod tests {
use std::ffi::CStr;
use std::os::raw::c_char;
use waku_sys::waku_content_topic;
2022-09-21 16:06:27 +02:00
#[test]
fn content_topic() {
let topic = unsafe {
waku_content_topic(
"foo_bar".as_ptr() as *mut c_char,
1,
"foo_topic".as_ptr() as *mut c_char,
"rfc26".as_ptr() as *mut c_char,
)
};
let topic_str = unsafe { CStr::from_ptr(topic) }
.to_str()
.expect("Decoded return");
println!("{}", topic_str);
2022-09-21 16:06:27 +02:00
}
}