gecko-dev/dom/media/gtest/hello.rs
Ralph Giles c832f2d6d6 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.

--HG--
extra : rebase_source : b35f41d565c6fda85ad010a328cd61b3c37681da
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()
}