diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-02-04 02:20:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-08 18:05:30 (GMT) |
commit | 83a5e453f8c0dc0fc9b6bdee9723478aafefd0da (patch) | |
tree | 787734e3c75d2a75cafbb054195473c24582e03e /Source/cmMakefile.cxx | |
parent | b26c70cc9a59de5b8ece8b00b67d571aaf6ee8f0 (diff) | |
download | CMake-83a5e453f8c0dc0fc9b6bdee9723478aafefd0da.zip CMake-83a5e453f8c0dc0fc9b6bdee9723478aafefd0da.tar.gz CMake-83a5e453f8c0dc0fc9b6bdee9723478aafefd0da.tar.bz2 |
stringapi: Use strings for test names
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 97628f3..ff0576e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3852,34 +3852,27 @@ cmTarget* cmMakefile::FindTarget(const std::string& name, } //---------------------------------------------------------------------------- -cmTest* cmMakefile::CreateTest(const char* testName) +cmTest* cmMakefile::CreateTest(const std::string& testName) { - if ( !testName ) - { - return 0; - } cmTest* test = this->GetTest(testName); if ( test ) { return test; } test = new cmTest(this); - test->SetName(testName); + test->SetName(testName.c_str()); this->Tests[testName] = test; return test; } //---------------------------------------------------------------------------- -cmTest* cmMakefile::GetTest(const char* testName) const +cmTest* cmMakefile::GetTest(const std::string& testName) const { - if(testName) + std::map<cmStdString, cmTest*>::const_iterator + mi = this->Tests.find(testName); + if(mi != this->Tests.end()) { - std::map<cmStdString, cmTest*>::const_iterator - mi = this->Tests.find(testName); - if(mi != this->Tests.end()) - { - return mi->second; - } + return mi->second; } return 0; } |