| 34 | } |
| 35 | |
| 36 | void readFile(const char* file_path) { |
| 37 | |
| 38 | size_t pre_memory = RNS::Utilities::Memory::heap_available(); |
| 39 | TRACEF("testReadFile: pre-mem: %u", pre_memory); |
| 40 | |
| 41 | { |
| 42 | RNS::Bytes data; |
| 43 | size_t read = RNS::Utilities::OS::read_file(file_path, data); |
| 44 | TEST_ASSERT_EQUAL_size_t(4, read); |
| 45 | TEST_ASSERT_EQUAL_STRING("test", data.toString().c_str()); |
| 46 | } |
| 47 | |
| 48 | size_t post_memory = RNS::Utilities::Memory::heap_available(); |
| 49 | size_t diff_memory = (int)pre_memory - (int)post_memory; |
| 50 | TRACEF("testReadFile: post-mem: %u", post_memory); |
| 51 | TRACEF("testReadFile: diff-mem: %u", diff_memory); |
| 52 | TEST_ASSERT_EQUAL_size_t(0, diff_memory); |
| 53 | |
| 54 | } |
| 55 | |
| 56 | void overwriteFile(const char* file_path) { |
| 57 |
no test coverage detected