From 9318871c31e8bf1036de35fe60f7c47f2cdddcfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Mon, 13 Mar 2023 23:55:35 +0100 Subject: [PATCH] Fixed tests from mem_cmp --- src/simulator/mem_cmp.rs | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/src/simulator/mem_cmp.rs b/src/simulator/mem_cmp.rs index 6822d8d..e8562a0 100644 --- a/src/simulator/mem_cmp.rs +++ b/src/simulator/mem_cmp.rs @@ -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{