base: bug in util_mmio.run

Fix #659
This commit is contained in:
Martin Stein 2013-04-06 18:35:18 +02:00 committed by Norman Feske
parent ba9e7185a8
commit e9f4e6b37d
2 changed files with 24 additions and 12 deletions

View File

@ -1,5 +1,13 @@
#
# Build
#
build "core init test/util_mmio"
#
# Boot image
#
create_boot_directory
install_config {
@ -16,7 +24,8 @@ install_config {
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<start name="test-util_mmio">
<start name="test">
<binary name="test-util_mmio"/>
<resource name="RAM" quantum="10M"/>
</start>
</config>
@ -24,12 +33,20 @@ install_config {
build_boot_image "core init test-util_mmio"
#
# Execution
#
append qemu_args "-nographic -m 64"
run_genode_until {.*Test ended.*} 10
run_genode_until "Test done.*\n" 10
grep_output {\[init -\> test-util_mmio\]}
#
# Conclusion
#
grep_output {\[init -\> test\]}
compare_output_to {
[init -> test-util_mmio] Test ended successfully
[init -> test] Test done
}

View File

@ -54,12 +54,6 @@ struct Cpu_state : Register<16>
inline static void write(access_t & v) { cpu_state = v; }
};
struct A : public Mmio {
A(addr_t const base) : Mmio(base) { }
};
/**
* Exemplary MMIO region type
*/
@ -170,10 +164,11 @@ int compare_mem(uint8_t * base1, uint8_t * base2, size_t size)
*/
int test_failed(unsigned test_id)
{
PERR("Test ended, test %i failed", test_id);
printf("Test %i failed\n", test_id);
printf(" mmio_mem: 0x ");
dump_mem(mmio_mem, sizeof(mmio_mem));
printf("\n cpu_state: 0x%4X\n", cpu_state);
printf("Test done\n");
return -1;
}
@ -405,7 +400,7 @@ int main()
if (compare_mem(mmio_mem, mmio_cmpr_15, sizeof(mmio_mem))) {
return test_failed(15); }
printf("Test ended successfully\n");
printf("Test done\n");
return 0;
}