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

Method checkSpiffsGen

tests/HostTests/modules/Spiffs.cpp:82–104  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 4

fileGetSystemInfoFunction · 0.85
findDeviceFunction · 0.85
toStringFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected