bootloader: repeat memory test 4 times

This commit is contained in:
Robert Jördens 2018-03-20 09:56:02 +00:00
parent 6fb0cbfcd3
commit 495625b99d

View File

@ -64,6 +64,7 @@ fn memory_test(total: &mut usize, wrong: &mut usize) -> bool {
fn prng32(seed: &mut u32) -> u32 { *seed = 1664525 * *seed + 1013904223; *seed } fn prng32(seed: &mut u32) -> u32 { *seed = 1664525 * *seed + 1013904223; *seed }
fn prng16(seed: &mut u16) -> u16 { *seed = 25173 * *seed + 13849; *seed } fn prng16(seed: &mut u16) -> u16 { *seed = 25173 * *seed + 13849; *seed }
for _ in 0..4 {
// Test data bus // Test data bus
test!((); for i in (0..0x100) { MEMORY[i] = 0xAAAAAAAA }); test!((); for i in (0..0x100) { MEMORY[i] = 0xAAAAAAAA });
test!((); for i in (0..0x100) { MEMORY[i] = 0x55555555 }); test!((); for i in (0..0x100) { MEMORY[i] = 0x55555555 });
@ -75,7 +76,7 @@ fn memory_test(total: &mut usize, wrong: &mut usize) -> bool {
// Test random addressing with counter data // Test random addressing with counter data
test!(let mut seed = 0; test!(let mut seed = 0;
for i in (0..0x10000) { MEMORY[prng16(&mut seed)] = i }); for i in (0..0x10000) { MEMORY[prng16(&mut seed)] = i });
}
*wrong == 0 *wrong == 0
} }