Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Artur Ryt
KWSys
Commits
6ef1cb1b
Commit
6ef1cb1b
authored
18 years ago
by
Ken Martin
Browse files
Options
Downloads
Patches
Plain Diff
ENH: better coverage
parent
14cde762
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SystemTools.hxx.in
+14
-17
14 additions, 17 deletions
SystemTools.hxx.in
testSystemTools.cxx
+40
-2
40 additions, 2 deletions
testSystemTools.cxx
with
54 additions
and
19 deletions
SystemTools.hxx.in
+
14
−
17
View file @
6ef1cb1b
...
...
@@ -255,6 +255,20 @@ public:
*/
static kwsys_stl::string ConvertToOutputPath(const char*);
/**
* Convert the path to a string that can be used in a unix makefile.
* double slashes are removed, and spaces are escaped.
*/
static kwsys_stl::string ConvertToUnixOutputPath(const char*);
/**
* Convert the path to string that can be used in a windows project or
* makefile. Double slashes are removed if they are not at the start of
* the string, the slashes are converted to windows style backslashes, and
* if there are spaces in the string it is double quoted.
*/
static kwsys_stl::string ConvertToWindowsOutputPath(const char*);
/**
* Return true if a file exists in the current directory
*/
...
...
@@ -429,12 +443,6 @@ public:
*/
static bool IsSubDirectory(const char* fileOrDir, const char* dir);
/**
* Convert the path to a string that can be used in a unix makefile.
* double slashes are removed, and spaces are escaped.
*/
static kwsys_stl::string ConvertToUnixOutputPath(const char*);
/** -----------------------------------------------------------------
* File Manipulation Routines
* -----------------------------------------------------------------
...
...
@@ -754,17 +762,6 @@ public:
static void ConvertWindowsCommandLineToUnixArguments(
const char *cmd_line, int *argc, char ***argv);
protected:
// these two functions can be called from ConvertToOutputPath
/**
* Convert the path to string that can be used in a windows project or
* makefile. Double slashes are removed if they are not at the start of
* the string, the slashes are converted to windows style backslashes, and
* if there are spaces in the string it is double quoted.
*/
static kwsys_stl::string ConvertToWindowsOutputPath(const char*);
private:
/**
* Allocate the std::map that serve as the Path Translation table.
...
...
This diff is collapsed.
Click to expand it.
testSystemTools.cxx
+
40
−
2
View file @
6ef1cb1b
...
...
@@ -93,7 +93,7 @@ bool CheckEscapeChars(kwsys_stl::string input,
}
//----------------------------------------------------------------------------
bool
Check
DetectFileType
()
bool
Check
FileOperations
()
{
bool
res
=
true
;
...
...
@@ -114,6 +114,14 @@ bool CheckDetectFileType()
<<
TEST_SYSTEMTOOLS_SRC_FILE
<<
kwsys_ios
::
endl
;
res
=
false
;
}
if
(
kwsys
::
SystemTools
::
FileLength
(
TEST_SYSTEMTOOLS_BIN_FILE
)
!=
766
)
{
kwsys_ios
::
cerr
<<
"Problem with FileLength - incorrect length for: "
<<
TEST_SYSTEMTOOLS_BIN_FILE
<<
kwsys_ios
::
endl
;
res
=
false
;
}
return
res
;
}
...
...
@@ -264,7 +272,37 @@ bool CheckStringOperations()
<<
TEST_SYSTEMTOOLS_SRC_FILE
<<
kwsys_ios
::
endl
;
res
=
false
;
}
if
(
kwsys
::
SystemTools
::
ConvertToWindowsOutputPath
(
"L://Local Mojo/Hex Power Pack/Iffy Voodoo"
)
!=
"
\"
L:
\\
Local Mojo
\\
Hex Power Pack
\\
Iffy Voodoo
\"
"
)
{
kwsys_ios
::
cerr
<<
"Problem with ConvertToWindowsOutputPath "
<<
kwsys_ios
::
endl
;
res
=
false
;
}
if
(
kwsys
::
SystemTools
::
ConvertToWindowsOutputPath
(
"//grayson/Local Mojo/Hex Power Pack/Iffy Voodoo"
)
!=
"
\"\\\\
grayson
\\
Local Mojo
\\
Hex Power Pack
\\
Iffy Voodoo
\"
"
)
{
kwsys_ios
::
cerr
<<
"Problem with ConvertToWindowsOutputPath "
<<
kwsys_ios
::
endl
;
res
=
false
;
}
if
(
kwsys
::
SystemTools
::
ConvertToUnixOutputPath
(
"//Local Mojo/Hex Power Pack/Iffy Voodoo"
)
!=
"/Local
\\
Mojo/Hex
\\
Power
\\
Pack/Iffy
\\
Voodoo"
)
{
kwsys_ios
::
cerr
<<
"Problem with ConvertToUnixOutputPath "
<<
kwsys_ios
::
endl
;
res
=
false
;
}
int
targc
;
char
**
targv
;
kwsys
::
SystemTools
::
ConvertWindowsCommandLineToUnixArguments
...
...
@@ -312,7 +350,7 @@ int main(/*int argc, char* argv*/)
*
checkEscapeChars
[
cc
][
2
],
checkEscapeChars
[
cc
][
3
]);
}
res
&=
Check
DetectFileType
();
res
&=
Check
FileOperations
();
res
&=
CheckStringOperations
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment