MCPcopy Create free account
hub / github.com/KDE/kdiff3 / testFileRelPath

Method testFileRelPath

src/autotests/FileAccessTest.cpp:42–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 private Q_SLOTS:
41
42 void testFileRelPath()
43 {
44 FileAccessMoc mocFile, mocRoot, mocFile2;
45
46 mocRoot.setEngine(new FileAccessJobHandlerMoc(&mocRoot));
47 mocFile.setEngine(new FileAccessJobHandlerMoc(&mocFile));
48 mocFile2.setEngine(new FileAccessJobHandlerMoc(&mocFile2));
49
50 //Check remote url.
51 mocRoot.setFile(u8"fish://i@0.0.0.0/root");
52 QCOMPARE(mocRoot.fileRelPath(), u8"");
53
54 mocFile.setFile(u8"fish://i@0.0.0.0/root/x");
55 mocFile.setParent(&mocRoot);
56 QCOMPARE(mocFile.fileRelPath(), QStringLiteral("x"));
57
58 mocFile2.setFile("fish://i@0.0.0.0/root/x/y");
59 mocFile2.setParent(&mocFile);
60 QCOMPARE(mocFile2.fileRelPath(), QStringLiteral("x/y"));
61 }
62
63 void testUrl()
64 {

Callers

nothing calls this directly

Calls 4

setEngineMethod · 0.80
setFileMethod · 0.80
fileRelPathMethod · 0.80
setParentMethod · 0.45

Tested by

no test coverage detected