extern crate libc;

use std::ffi::CStr;
use std::os::raw::c_char;
use libc::size_t;
use libc::strncpy;

mod rnc {
    pub fn add(num_l: &str, num_r: &str) -> String {
        let sum = String::from(num_l) + num_r;

        if sum == "IIIII" {
            String::from("V")
        } else {
            sum
        }
    }

    #[cfg(test)]
    mod tests {
        use super::add;

        #[test]
        fn add_i_i() {
            assert_eq!("II", add("I", "I"));
        }

        #[test]
        fn add_i_ii() {
            assert_eq!("III", add("I", "II"));
        }

        #[test]
        fn add_ii_iii() {
            assert_eq!("V", add("II", "III"));

        }
    }
}

use rnc::add;

#[no_mangle]
pub extern fn rnc_add(dst: *mut c_char, dstlen: size_t, num_l: *const c_char, num_r: *const c_char) {
    unsafe {
        let sum = add(CStr::from_ptr(num_l).to_str().unwrap(), CStr::from_ptr(num_r).to_str().unwrap());
        strncpy(dst, sum.as_ptr() as *const i8, dstlen);
    }
}

extern crate libc;

use std::ffi::CStr;
use std::os::raw::c_char;
use libc::size_t;
use libc::strncpy;

mod rnc {
    #[test]
    fn add_i_i() {
        assert_eq!("II", add("I", "I"));
    }

    #[test]
    fn add_i_ii() {
        assert_eq!("III", add("I", "II"));
    }

    #[test]
    fn add_ii_iii() {
        assert_eq!("V", add("II", "III"));

    }

    pub fn add(num_l: &str, num_r: &str) -> String {
        let sum = String::from(num_l) + num_r;

        if sum == "IIIII" {
            String::from("V")
        } else {
            sum
        }
    }
}

use rnc::add;

#[no_mangle]
pub extern fn rnc_add(dst: *mut c_char, dstlen: size_t, num_l: *const c_char, num_r: *const c_char) {
    unsafe {
        let sum = add(CStr::from_ptr(num_l).to_str().unwrap(), CStr::from_ptr(num_r).to_str().unwrap());
        strncpy(dst, sum.as_ptr() as *const i8, dstlen);
    }
}

--- 
+++ 
@@ -6,22 +6,6 @@
 use libc::strncpy;
 
 mod rnc {
-    #[test]
-    fn add_i_i() {
-        assert_eq!("II", add("I", "I"));
-    }
-
-    #[test]
-    fn add_i_ii() {
-        assert_eq!("III", add("I", "II"));
-    }
-
-    #[test]
-    fn add_ii_iii() {
-        assert_eq!("V", add("II", "III"));
-
-    }
-
     pub fn add(num_l: &str, num_r: &str) -> String {
         let sum = String::from(num_l) + num_r;
 
@@ -29,6 +13,27 @@
             String::from("V")
         } else {
             sum
+        }
+    }
+
+    #[cfg(test)]
+    mod tests {
+        use super::add;
+
+        #[test]
+        fn add_i_i() {
+            assert_eq!("II", add("I", "I"));
+        }
+
+        #[test]
+        fn add_i_ii() {
+            assert_eq!("III", add("I", "II"));
+        }
+
+        #[test]
+        fn add_ii_iii() {
+            assert_eq!("V", add("II", "III"));
+
         }
     }
 }
Use more idiomatic rust testing
