asar coverage - build #


src/asar/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
10 of 10, 0 excluded
100.0%
Functions:
4 of 4, 0 excluded
100.0%
Branches:
6 of 12, 0 excluded
50.0%

platform/windows/file-helpers-win32.cpp
Line Branch Exec Source
1 // RPG Hacker: We can't include that here, because it leads to crazy
2 // errors in windows.h - probably related to our string class?!?
3 //#include "platform/file-helpers.h"
4
5 #if defined(_MSC_VER)
6 # pragma warning(push)
7 # pragma warning(disable : 4668)
8 # pragma warning(disable : 4987)
9 #endif
10
11 #include <windows.h>
12 #include <ctype.h>
13
14 #if defined(_MSC_VER)
15 # pragma warning(pop)
16 #endif
17
18 #include <ctype.h>
19
20 #include "../file-helpers.h"
21
22 783 bool file_exists(const char * filename)
23 {
24 783 return (GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES);
25 }
26
27 1384 bool path_is_absolute(const char* path)
28 {
29 2144 return ((isalpha(path[0]) &&
30
1/6
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 6 taken 760 times.
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 8 not taken.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 8 not taken.
760 (':' == path[1]) && (('\\' == path[2]) || ('/' == path[2]))) /* drive letter + root, e.g. C:\dir or C:/dir */
31
5/6
✓ Branch 2 → 3 taken 760 times.
✓ Branch 2 → 6 taken 624 times.
✓ Branch 6 → 7 taken 1384 times.
✗ Branch 6 → 8 not taken.
✓ Branch 7 → 8 taken 600 times.
✓ Branch 7 → 9 taken 784 times.
2144 || ('\\' == path[0]) || ('/' == path[0])); /* just root, e.g. \dir or /dir */
32 }
33
34 23 char get_native_path_separator()
35 {
36 23 return '\\';
37 }
38
39 235 bool check_is_regular_file(const char* path)
40 {
41 235 return !(GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY);
42 }
43