MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / TEST

Function TEST

test/loader/filemgrTest.cpp:27–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25WasmEdge::FileMgr Mgr;
26
27TEST(FileManagerTest, File__SetPath) {
28 // 1. Test opening data file.
29 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readByteTest.bin"));
30 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readU32Test.bin"));
31 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readU32TestTooLong.bin"));
32 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readU32TestTooLarge.bin"));
33 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readU64Test.bin"));
34 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readU64TestTooLong.bin"));
35 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readU64TestTooLarge.bin"));
36 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readS32Test.bin"));
37 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readS32TestTooLong.bin"));
38 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readS32TestTooLarge.bin"));
39 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readS64Test.bin"));
40 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readS64TestTooLong.bin"));
41 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readS64TestTooLarge.bin"));
42 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readF32Test.bin"));
43 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readF64Test.bin"));
44 EXPECT_TRUE(Mgr.setPath("filemgrTestData/readNameTest.bin"));
45 EXPECT_FALSE(Mgr.setPath("filemgrTestData/NO_THIS_FILE.bin"));
46 EXPECT_TRUE(Mgr.setCode(std::vector<uint8_t>{0x00, 0xFF}));
47}
48
49TEST(FileManagerTest, File__ReadByte) {
50 // 2. Test unsigned char reading.

Callers

nothing calls this directly

Calls 15

isnanFunction · 0.85
setPathMethod · 0.80
readByteMethod · 0.80
readBytesMethod · 0.80
readU32Method · 0.80
readU64Method · 0.80
readS32Method · 0.80
readS64Method · 0.80
readF32Method · 0.80
readF64Method · 0.80
readNameMethod · 0.80
peekByteMethod · 0.80

Tested by

no test coverage detected