GCC Code Coverage Report


Directory: ./
File: TESTS/TEST_FILENAME/main.cpp
Date: 2024-11-14 16:05:39
Exec Total Coverage
Lines: 90 90 100.0%
Branches: 554 554 100.0%

Line Branch Exec Source
1
2 /***************************************
3 Auteur : Pierre Aubert
4 Mail : pierre.aubert@lapp.in2p3.fr
5 Licence : CeCILL-C
6 ****************************************/
7
8 #include <iostream>
9 #include <vector>
10 #include "phoenix_assert.h"
11 #include "phoenix_check.h"
12
13 #include "string_filename.h"
14
15 ///Check string lower expression
16 /** @param testName : name of the test
17 * @param strValue : string to be tested
18 * @param strReference : reference string
19 * @return true is both strings are equal, false otherwise
20 */
21 14 bool checkString(const std::string & testName, const std::string & strValue, const std::string & strReference){
22 14 return phoenix_check(testName, strValue, strReference);
23 }
24
25 ///Test the string filename function
26 1 void testStringFilename(){
27
1/1
✓ Branch 2 taken 1 times.
1 std::string fileName("someDir/someOtherDir/fileName.extention");
28
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
✓ Branch 27 taken 1 times.
1 phoenix_assert(checkString("Test getFileName", getFileName(fileName), "fileName.extention"));
29
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
✓ Branch 27 taken 1 times.
1 phoenix_assert(checkString("Test getDirectory", getDirectory(fileName), "someDir/someOtherDir"));
30
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
✓ Branch 27 taken 1 times.
1 phoenix_assert(checkString("Test eraseExtension", eraseExtension(fileName), "someDir/someOtherDir/fileName"));
31
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
✓ Branch 27 taken 1 times.
1 phoenix_assert(checkString("Test getExtention", getExtention(fileName), "extention"));
32
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test getExtention", getExtention("fileWithoutExtention"), ""));
33
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test eraseExtension", eraseExtension(""), ""));
34
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test eraseExtension", eraseExtension("file.tar.gz"), "file.tar"));
35
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
✓ Branch 27 taken 1 times.
1 phoenix_assert(checkString("Test getLongestExtention", getLongestExtention(fileName), "extention"));
36
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test getLongestExtention", getLongestExtention("fileWithoutExtention"), ""));
37
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test getLongestExtention", getLongestExtention("Shadok.tar.gz"), "tar.gz"));
38
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test getLongestExtention", getLongestExtention("../Shadok.tar.gz"), "tar.gz"));
39
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test eraseLongestExtension", eraseLongestExtension(""), ""));
40
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test eraseLongestExtension", eraseLongestExtension("file.tar.gz"), "file"));
41
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(checkString("Test eraseLongestExtension", eraseLongestExtension("../file.tar.gz"), "../file"));
42
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(isFileOrDirExist("Makefile"));
43
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(isFileOrDirExist("CMakeFiles"));
44
45
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!isFileExist(""));
46
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!isFileOrDirExist(""));
47
48
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(isFileExist("./Makefile"));
49
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!isFileExist("CMakeFiles"));
50
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!isFileExist("SomeInexistingFile"));
51
7/7
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
✓ Branch 23 taken 1 times.
1 phoenix_assert(getFileContent("Makefile") != "");
52
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("Test getFileContent missing file", getFileContent("SomeInexistingFile"), ""));
53
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
✓ Branch 27 taken 1 times.
1 phoenix_assert(phoenix_check("Test getFileContent NULL", getFileContent(NULL), ""));
54
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!saveFileContent(NULL, ""));
55
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!saveFileContent(NULL, "some string"));
56
57
7/7
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
1 phoenix_assert(saveFileContent("testFile.txt", "some file content"));
58
7/7
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
1 phoenix_assert(!saveFileContent("", "some file content"));
59
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!isDirectoryExist(""));
60
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(isDirectoryExist("CMakeFiles"));
61
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 24 taken 1 times.
✓ Branch 27 taken 1 times.
1 phoenix_assert(phoenix_check("Test isDirectoryExist not dir", isDirectoryExist("SomeInexistingDir"), false));
62
63
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 16 taken 1 times.
✓ Branch 19 taken 1 times.
1 phoenix_assert(getCurrentDirectory() != "");
64 1 std::vector<std::string> vecDir;
65
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("Test getExistingFileName empty", getExistingFileName("", vecDir), ""));
66
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("Test getExistingFileName", getExistingFileName("Makefile", vecDir), ""));
67
2/2
✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
1 vecDir.push_back("SomeInexistingDir");
68
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
1 phoenix_assert(getExistingFileName("", vecDir) == "");
69
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
1 phoenix_assert(getExistingFileName("Makefile", vecDir) == "");
70
2/2
✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
1 vecDir.push_back("./");
71
7/7
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
✓ Branch 23 taken 1 times.
1 phoenix_assert(getExistingFileName("Makefile", vecDir) != "");
72
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(createDirectoriesIfNotExist("someDir"));
73
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(createDirectoriesIfNotExist("someDir/someOtherDir"));
74
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(createDirectoriesIfNotExist("///"));
75
76
7/7
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
✓ Branch 23 taken 1 times.
1 phoenix_assert(makeAbsolutePath("") != "");
77
7/7
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
✓ Branch 23 taken 1 times.
1 phoenix_assert(makeAbsolutePath("./dir") != "");
78
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 21 taken 1 times.
1 phoenix_assert(makeAbsolutePath("/usr/lib") == "/usr/lib");
79
80 1 std::vector<std::string> vecPath;
81
2/2
✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
1 vecPath.push_back("");
82
2/2
✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
1 vecPath.push_back("./dir");
83
2/2
✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
1 vecPath.push_back("/usr/lib");
84
1/1
✓ Branch 1 taken 1 times.
1 std::vector<std::string> vecAbsolutePath = makeAbsolutePath(vecPath);
85
5/5
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
1 phoenix_assert(vecAbsolutePath[0lu] != "");
86
5/5
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
1 phoenix_assert(vecAbsolutePath[1lu] != "");
87
4/4
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 15 taken 1 times.
1 phoenix_assert(vecAbsolutePath[2lu] == "/usr/lib");
88
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!isAbsolutePath(""));
89
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(isAbsolutePath("/someting/absolute"));
90
6/6
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 20 taken 1 times.
1 phoenix_assert(!isAbsolutePath("../someting/not/absolute"));
91
10/10
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 22 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 29 taken 1 times.
✓ Branch 32 taken 1 times.
✓ Branch 35 taken 1 times.
1 phoenix_assert(phoenix_check("getUnderPath : empty", getUnderPath("", ""), ""));
92
10/10
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 22 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 29 taken 1 times.
✓ Branch 32 taken 1 times.
✓ Branch 35 taken 1 times.
1 phoenix_assert(phoenix_check("getUnderPath : base", getUnderPath("/some/dir/path", "dir"), "path"));
93
10/10
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 22 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 29 taken 1 times.
✓ Branch 32 taken 1 times.
✓ Branch 35 taken 1 times.
1 phoenix_assert(phoenix_check("getUnderPath : not found", getUnderPath("/some/dir/path", "nothere"), ""));
94
95 1 std::vector<std::string> vecUnderPath;
96
2/2
✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
1 vecUnderPath.push_back("/usr/lib/shadok.so");
97
2/2
✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
1 vecUnderPath.push_back("/usr/bin/shadok");
98
2/2
✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
2 std::vector<std::string> vecOutUnderPath = getUnderPath(vecUnderPath, "usr");
99
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 19 taken 1 times.
✓ Branch 22 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
1 phoenix_assert(phoenix_check("getUnderPath("+vecUnderPath[0]+")", vecOutUnderPath[0], "lib/shadok.so"));
100
8/8
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 19 taken 1 times.
✓ Branch 22 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
1 phoenix_assert(phoenix_check("getUnderPath("+vecUnderPath[1]+")", vecOutUnderPath[1], "bin/shadok"));
101
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : empty", removePathDots(""), ""));
102
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : relative", removePathDots("./some/path"), "./some/path"));
103
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : relative path", removePathDots("some/relative/path"), "some/relative/path"));
104
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : absolute path", removePathDots("/some/absolute/path"), "/some/absolute/path"));
105
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dot relative path", removePathDots("some/./relative/path"), "some/relative/path"));
106
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dot absolute path", removePathDots("/some/./absolute/path"), "/some/absolute/path"));
107
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dots relative path", removePathDots("some/relative/../path"), "some/path"));
108
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dots absolute path", removePathDots("/some/absolute/../path"), "/some/path"));
109
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dots 2 relative path", removePathDots("some/../relative/../path"), "path"));
110
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dots 2 absolute path", removePathDots("/some/../absolute/../path"), "/path"));
111
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dots 1.5 relative path", removePathDots("some/./relative/../path"), "some/path"));
112
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dots 1.5 absolute path", removePathDots("/some/./absolute/../path"), "/some/path"));
113
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dots 1.8 relative path", removePathDots("some//relative/../path"), "some/path"));
114
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("removePathDots : dots 1.8 absolute path", removePathDots("/some//absolute/../path"), "/some/path"));
115
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("getDirName : /some/dir", getDirName("/some/dir"), "dir"));
116
9/9
✓ Branch 2 taken 1 times.
✓ Branch 6 taken 1 times.
✓ Branch 10 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 18 taken 1 times.
✓ Branch 21 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 31 taken 1 times.
1 phoenix_assert(phoenix_check("getDirName : /some/dir/again/", getDirName("/some/dir/again/"), "again"));
117 1 }
118
119 1 int main(int argc, char** argv){
120 1 testStringFilename();
121 1 return 0;
122 }
123
124
125