ENH: increase coverage

This commit is contained in:
Bill Hoffman 2002-05-23 13:23:35 -04:00
parent 14b07c0973
commit 2d9e5edb27
8 changed files with 63 additions and 24 deletions

View File

@ -1789,23 +1789,6 @@ std::string cmSystemTools::GetFilenameExtension(const std::string& filename)
}
}
/**
* Return file extension of a full filename (dot included).
*/
std::string cmSystemTools::GetFilenameShortestExtension(const std::string& filename)
{
std::string name = cmSystemTools::GetFilenameName(filename);
std::string::size_type dot_pos = name.rfind(".");
if(dot_pos != std::string::npos)
{
return name.substr(dot_pos);
}
else
{
return "";
}
}
/**
* Return file name without extension of a full filename (i.e. without path).

View File

@ -248,7 +248,6 @@ public:
///! return file extension of a full filename (dot included).
static std::string GetFilenameExtension(const std::string&);
static std::string GetFilenameShortestExtension(const std::string&);
///! return file name without extension of a full filename.
static std::string GetFilenameNameWithoutExtension(const std::string&);

View File

@ -103,7 +103,12 @@ ENDFOREACH (ext)
FIND_LIBRARY(FIND_DUMMY_LIB
dummylib
PATHS
${Complex_BINARY_DIR}/Library)
${Complex_BINARY_DIR}/Library DOC "find dummy lib")
FIND_LIBRARY(FIND_DUMMY_LIB
NAMES dummylib dummylib2
PATHS
${Complex_BINARY_DIR}/Library DOC "find dummy lib")
#
# Test SET_SOURCE_FILES_PROPERTIES
@ -135,7 +140,7 @@ IF (WIN32)
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "write_regv \"${hkey}\" \"${dir}\"")
FIND_PATH(REGISTRY_TEST_PATH
${file}
"[${hkey}]")
"[${hkey}]" DOC "Registry_Test_Path")
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "delete_regv \"${hkey}\"")
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "remove \"${dir}/${file}\"")
ENDIF (NOT UNIX)

View File

@ -691,6 +691,20 @@ int main()
cmFailed("ESCAPE_QUOTES is not working");
}
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
// ----------------------------------------------------------------------
// Summary

View File

@ -103,7 +103,12 @@ ENDFOREACH (ext)
FIND_LIBRARY(FIND_DUMMY_LIB
dummylib
PATHS
${Complex_BINARY_DIR}/Library)
${Complex_BINARY_DIR}/Library DOC "find dummy lib")
FIND_LIBRARY(FIND_DUMMY_LIB
NAMES dummylib dummylib2
PATHS
${Complex_BINARY_DIR}/Library DOC "find dummy lib")
#
# Test SET_SOURCE_FILES_PROPERTIES
@ -135,7 +140,7 @@ IF (WIN32)
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "write_regv \"${hkey}\" \"${dir}\"")
FIND_PATH(REGISTRY_TEST_PATH
${file}
"[${hkey}]")
"[${hkey}]" DOC "Registry_Test_Path")
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "delete_regv \"${hkey}\"")
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "remove \"${dir}/${file}\"")
ENDIF (NOT UNIX)

View File

@ -691,6 +691,20 @@ int main()
cmFailed("ESCAPE_QUOTES is not working");
}
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
// ----------------------------------------------------------------------
// Summary

View File

@ -103,7 +103,12 @@ ENDFOREACH (ext)
FIND_LIBRARY(FIND_DUMMY_LIB
dummylib
PATHS
${Complex_BINARY_DIR}/Library)
${Complex_BINARY_DIR}/Library DOC "find dummy lib")
FIND_LIBRARY(FIND_DUMMY_LIB
NAMES dummylib dummylib2
PATHS
${Complex_BINARY_DIR}/Library DOC "find dummy lib")
#
# Test SET_SOURCE_FILES_PROPERTIES
@ -135,7 +140,7 @@ IF (WIN32)
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "write_regv \"${hkey}\" \"${dir}\"")
FIND_PATH(REGISTRY_TEST_PATH
${file}
"[${hkey}]")
"[${hkey}]" DOC "Registry_Test_Path")
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "delete_regv \"${hkey}\"")
EXEC_PROGRAM(${CCOMMAND_COMMAND} ARGS "remove \"${dir}/${file}\"")
ENDIF (NOT UNIX)

View File

@ -691,6 +691,20 @@ int main()
cmFailed("ESCAPE_QUOTES is not working");
}
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
std::string strupper = "ABC";
if(cmSystemTools::UpperCase(str) == strupper)
{
cmPassed("cmSystemTools::UpperCase is working");
}
else
{
cmFailed("cmSystemTools::UpperCase is working");
}
// ----------------------------------------------------------------------
// Summary