MCPcopy Create free account
hub / github.com/attermann/microReticulum / testRead

Function testRead

test/test_persistence/test_persistence.cpp:90–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void testRead() {
91 RNS::Bytes data;
92 if (RNS::Utilities::OS::read_file(test_file_path, data) > 0) {
93 TRACEF("read: %lu bytes", data.size());
94 TRACEF("data: %s", data.toString().c_str());
95 TEST_ASSERT_EQUAL_size_t(strlen(test_file_data), data.size());
96 TEST_ASSERT_NOT_NULL(data.data());
97 TEST_ASSERT_EQUAL_MEMORY(test_file_data, data.data(), strlen(test_file_data));
98 //assert(RNS::Utilities::OS::remove_file(test_file_path));
99 }
100 else {
101 TRACE("read failed");
102 TEST_FAIL();
103 }
104}
105
106
107const char test_object_path[] = "./test_object";

Callers

nothing calls this directly

Calls 3

dataMethod · 0.80
sizeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected