-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.cpp
More file actions
30 lines (28 loc) · 781 Bytes
/
test.cpp
File metadata and controls
30 lines (28 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <string>
#include "casecorrectpath.h"
void CheckCase(const char* path){
FILE *file = fopen(path, "rb");
if(file){
fclose(file);
} else {
printf("There is no file: %s\n", path);
return;
}
std::string corrected;
if(IsPathCaseCorrect(path, &corrected)){
printf("Case is correct: %s\n", corrected.c_str());
} else {
printf("Case is not correct: %s\n", path);
printf("The correct case is: %s\n", corrected.c_str());
}
}
int main(int argc, char* argv[]){
CheckCase("casecorrectpath.cpp");
CheckCase("CaseCorrectPath.H");
CheckCase("CASECORRECTPATH.CPP");
#ifdef _WIN32
printf("\nTest completed, press 'enter' to quit\n");
getchar();
#endif
}