MCPcopy Create free account
hub / github.com/SmingHub/Sming / testRead

Method testRead

tests/HostTests/modules/Storage.cpp:76–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 }
75
76 void testRead(Storage::Partition& part, uint32_t address, size_t size, bool shouldSucceed)
77 {
78 auto buf = new uint8_t[size];
79 bool success = part.read(address, buf, size);
80 if(success) {
81 m_printHex("READ", buf, size, address);
82 REQUIRE(shouldSucceed == true);
83 } else {
84 debug_e("read(0x%08x, %u) failed", address, size);
85 REQUIRE(shouldSucceed == false);
86 }
87 delete[] buf;
88 }
89};
90
91void REGISTER_TEST(Storage)

Callers

nothing calls this directly

Calls 2

m_printHexFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected