mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00:00
rom_blk test: abort if test fails
Instead of printing the success message at the end of the test, abort as soon as two blocks differ. Ref #966
This commit is contained in:
parent
66d499e416
commit
adc63ef2a6
@ -17,6 +17,7 @@
|
||||
#include <base/allocator_avl.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/sleep.h>
|
||||
#include <base/exception.h>
|
||||
#include <base/thread.h>
|
||||
#include <os/config.h>
|
||||
#include <block_session/connection.h>
|
||||
@ -31,6 +32,8 @@ class Comparer : public Genode::Thread<8192>
|
||||
Genode::Rom_connection _rom;
|
||||
Genode::addr_t _addr;
|
||||
|
||||
class Block_file_differ : Genode::Exception {};
|
||||
|
||||
public:
|
||||
|
||||
enum {
|
||||
@ -87,8 +90,10 @@ class Comparer : public Genode::Thread<8192>
|
||||
if (blk_src[j*blk_size+k] != rom_src[j*blk_size+k])
|
||||
differ = true;
|
||||
}
|
||||
if (differ)
|
||||
if (differ) {
|
||||
PWRN("block %zx differs!", i);
|
||||
throw Block_file_differ();
|
||||
}
|
||||
source->release_packet(p);
|
||||
} catch (Block::Session::Tx::Source::Packet_alloc_failed) {
|
||||
PERR("Mmh, strange we run out of packets");
|
||||
|
Loading…
x
Reference in New Issue
Block a user