From b9774c47eecd0c90e503919432ec1e4a86355398 Mon Sep 17 00:00:00 2001 From: Cyril Bur Date: Tue, 5 Dec 2017 12:01:13 +1100 Subject: libflash/test: Add tests for mbox-flash A first basic set of tests for mbox-flash. These tests do their testing by stubbing out or otherwise replacing functions not in libflash/mbox-flash.c. The stubbed out version of the function can then be used to emulate a BMC mbox daemon talking to back to the code in mbox-flash and it can ensure that there is some adherence to the protocol and that from a blocklevel api point of view the world appears sane. This makes these tests simple to run and they have been integrated into `make check`. The down side is that these tests rely on duplicated feature incomplete BMC daemon behaviour. Therefore these tests are a strong indicator of broken behaviour but a very unreliable indicator of correctness. Full integration tests with a 'real' BMC daemon are probably beyond the scope of this repository. Signed-off-by: Cyril Bur [stewart: fix TESTS_LOOPS printf] Signed-off-by: Stewart Smith --- include/skiboot.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/skiboot.h') diff --git a/include/skiboot.h b/include/skiboot.h index 03b82a8..d7aeb27 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -146,6 +146,7 @@ extern unsigned int pcie_max_link_speed; /* Convert a 4-bit number to a hex char */ extern char __attrconst tohex(uint8_t nibble); +#ifndef __TEST__ /* Bit position of the most significant 1-bit (LSB=0, MSB=63) */ static inline int ilog2(unsigned long val) { @@ -160,6 +161,7 @@ static inline bool is_pow2(unsigned long val) { return val == (1ul << ilog2(val)); } +#endif #define lo32(x) ((x) & 0xffffffff) #define hi32(x) (((x) >> 32) & 0xffffffff) -- cgit v1.1