gecko/dom/media/gtest/hello.rs
Ralph Giles 3953bd28c0 Bug 1161339 - Add gtest calling rust code. r=cajbir
This is mostly to verify compilation and linkage.
The test itself just verifies the contents of an
returned string.
2015-05-07 12:15:00 -07:00

7 lines
164 B
Rust

#[no_mangle]
pub extern fn test_rust() -> *const u8 {
// NB: rust &str aren't null terminated.
let greeting = "hello from rust.\0";
greeting.as_ptr()
}