Fixed tests from mem_cmp
This commit is contained in:
parent
65ac9c6f06
commit
9318871c31
@ -279,44 +279,16 @@ fn two_hex_to_u8(c1: char, c2: char) -> u8 {
|
||||
16*a + b
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Juste pour voir si via BufReader les \n sont présent, apres test il s'avère que non
|
||||
* De toute facon on limitera d'une section la lecture par len
|
||||
*/
|
||||
fn test_show_sections_file(){
|
||||
let file = fs::File::open("test_file_section.txt").expect("Wrong filename");
|
||||
let reader = BufReader::new(file);
|
||||
|
||||
for line in reader.lines() {
|
||||
//println!("Tailles de la ligne : {}",
|
||||
let current = line.unwrap();
|
||||
//println!("Taille de la ligne : {}", current.len()); // En effet pas de \n dans chaque line, parfait
|
||||
println!("{}", ¤t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_fill_memory(){
|
||||
let path = "osef".to_string();
|
||||
let m_c = MemChecker::from(&path).unwrap();
|
||||
let m_c = MemChecker::from("test/machine/memory.txt").unwrap();
|
||||
let mut machine = Machine::init_machine();
|
||||
|
||||
MemChecker::fill_memory_from_mem_checker(&m_c, &mut machine);
|
||||
|
||||
print!("\n Comparing memory from loaded context\n\n");
|
||||
|
||||
MemChecker::compare_print_m_c_machine(&m_c, &mut machine);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -330,8 +302,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_create_mem_checker(){
|
||||
let path: String = "osef".to_string();
|
||||
let m_c = MemChecker::from(&path).unwrap();
|
||||
let m_c = MemChecker::from("test/machine/memory.txt").unwrap();
|
||||
MemChecker::print_mem_checker(&m_c);
|
||||
}
|
||||
|
||||
@ -346,12 +317,6 @@ mod tests {
|
||||
assert_eq!(expected,result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tmp_fct_read_file(){
|
||||
println!("Reading A file \n");
|
||||
test_show_sections_file();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_section_content(){
|
||||
let section_format = SectionFormat{
|
||||
|
Loading…
Reference in New Issue
Block a user