mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-22 02:16:44 +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/allocator_avl.h>
|
||||||
#include <base/printf.h>
|
#include <base/printf.h>
|
||||||
#include <base/sleep.h>
|
#include <base/sleep.h>
|
||||||
|
#include <base/exception.h>
|
||||||
#include <base/thread.h>
|
#include <base/thread.h>
|
||||||
#include <os/config.h>
|
#include <os/config.h>
|
||||||
#include <block_session/connection.h>
|
#include <block_session/connection.h>
|
||||||
@ -31,6 +32,8 @@ class Comparer : public Genode::Thread<8192>
|
|||||||
Genode::Rom_connection _rom;
|
Genode::Rom_connection _rom;
|
||||||
Genode::addr_t _addr;
|
Genode::addr_t _addr;
|
||||||
|
|
||||||
|
class Block_file_differ : Genode::Exception {};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -87,8 +90,10 @@ class Comparer : public Genode::Thread<8192>
|
|||||||
if (blk_src[j*blk_size+k] != rom_src[j*blk_size+k])
|
if (blk_src[j*blk_size+k] != rom_src[j*blk_size+k])
|
||||||
differ = true;
|
differ = true;
|
||||||
}
|
}
|
||||||
if (differ)
|
if (differ) {
|
||||||
PWRN("block %zx differs!", i);
|
PWRN("block %zx differs!", i);
|
||||||
|
throw Block_file_differ();
|
||||||
|
}
|
||||||
source->release_packet(p);
|
source->release_packet(p);
|
||||||
} catch (Block::Session::Tx::Source::Packet_alloc_failed) {
|
} catch (Block::Session::Tx::Source::Packet_alloc_failed) {
|
||||||
PERR("Mmh, strange we run out of packets");
|
PERR("Mmh, strange we run out of packets");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user