fn core_unitests<F, R>(ncases: &mut u64, failurecases: &mut Vec<String>, f:F, name: &str )
            where F: FnOnce() -> R + UnwindSafe {
            *ncases = *ncases + 1;
            match std::panic::catch_unwind (|| { f(); } ).is_ok() {
                true => {
                    debug_println!("{} {} ... {}!",
                         "testing",
                         name,
                         "\x1B[1;32mok\x1B[0m");
                },
                false => {
                    debug_println!("{} {} ... {}!",
                         "testing",
                         name,
                         "\x1B[1;31mfailed\x1B[0m");
                    failurecases.push(String::from(name));
                },
            }
        }
/// Perform one test case at a time.
///
/// This is the core function of sgx_tunittest. It runs one test case at a
/// time and saves the result. On test passes, it increases the passed counter
/// and on test fails, it records the failed test.
Perform one test case at a time.
This is the core function of sgx_tunittest. It runs one test case at a
time and saves the result. On test passes, it increases the passed counter
and on test fails, it records the failed test.
Perform one test case at a time . This is the core function of sgx_tunittest . It runs one test case at a time and saves the result . On test passes it increases the passed counter and on test fails it records the failed test .
fn core_unitests<F, R>(ncases: &mut u64, failurecases: &mut Vec<String>, f:F, name: &str )
            where F: FnOnce() -> R + UnwindSafe {
            *ncases = *ncases + 1;
            match std::panic::catch_unwind (|| { f(); } ).is_ok() {
                true => {
                    debug_println!("{} {} ... {}!",
                         "testing",
                         name,
                         "\x1B[1;32mok\x1B[0m");
                },
                false => {
                    debug_println!("{} {} ... {}!",
                         "testing",
                         name,
                         "\x1B[1;31mfailed\x1B[0m");
                    failurecases.push(String::from(name));
                },
            }
        }
fn core_unitests < F , R > ( ncases : & mut u64 , failurecases : & mut Vec < String > , f : F , name : & str ) where F : FnOnce ( ) -> R + UnwindSafe { * ncases = * ncases + 1 ; match std :: panic :: catch_unwind ( | | { f ( ) ; } ) . is_ok ( ) { true => { debug_println ! ( " " " " name " \x1B \x1B " ) ; } , false => { debug_println ! ( " " " " name " \x1B \x1B " ) ; failurecases . push ( String :: from ( name ) ) ; } , } }
Perform one test case at a time.
Perform one test case at a time .
ncases
&mut u64
failurecases
&mut Vec<String>
f
F
name
&str
ncases
&mut u64
failurecases
&mut Vec<String>
f
F
name
&str