* Verify that a legacy volume (i.e. one generated with spiffy before IFS was introduced) * can still be read correctly. * * Compare content of all files to ensure they are identical. */
| 80 | * Compare content of all files to ensure they are identical. |
| 81 | */ |
| 82 | void checkSpiffsGen() |
| 83 | { |
| 84 | IFS::FileSystem::Info info; |
| 85 | int err = fileGetSystemInfo(info); |
| 86 | CHECK(err >= 0); |
| 87 | debug_i("fs attr = %s", toString(info.attr).c_str()); |
| 88 | |
| 89 | IFS::FileSystem* fsOld; |
| 90 | if(info.attr[IFS::FileSystem::Attribute::NoMeta]) { |
| 91 | fsOld = mountSpiffsFromFile("old", "spiffsgen/spiff_rom_orig.bin"); |
| 92 | } else { |
| 93 | fsOld = mountSpiffsFromFile("old", "spiffsgen/spiff_rom_meta.bin"); |
| 94 | } |
| 95 | auto fsNew = mountSpiffsFromFile("new", "out/spiff_rom_test.bin"); |
| 96 | |
| 97 | readCheck(fsOld, fsNew); |
| 98 | |
| 99 | delete fsNew; |
| 100 | delete fsOld; |
| 101 | |
| 102 | delete Storage::findDevice("new"); |
| 103 | delete Storage::findDevice("old"); |
| 104 | } |
| 105 | |
| 106 | IFS::FileSystem* mountSpiffsFromFile(const String& tag, const String& filename) |
| 107 | { |
nothing calls this directly
no test coverage detected