Browse Subversion Repository
Contents of /common/TestSearchFilePath.cpp
Parent Directory
| Revision Log
Revision 279 -
( show annotations)
( download)
( as text)
Wed Mar 12 05:28:19 2008 UTC
(16 years, 2 months ago)
by satofumi
File MIME type: text/x-c++src
File size: 968 byte(s)
adjust tab index
| 1 |
/*! |
| 2 |
\file |
| 3 |
\brief SearchFilePath のテスト |
| 4 |
|
| 5 |
\author Satofumi KAMIMURA |
| 6 |
|
| 7 |
$Id$ |
| 8 |
*/ |
| 9 |
|
| 10 |
#include "TestSearchFilePath.h" |
| 11 |
#include "SearchFilePath.h" |
| 12 |
|
| 13 |
|
| 14 |
CPPUNIT_TEST_SUITE_REGISTRATION(SearchFilePathTest); |
| 15 |
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(SearchFilePathTest, |
| 16 |
"SearchFilePathTest"); |
| 17 |
|
| 18 |
using namespace beego; |
| 19 |
|
| 20 |
|
| 21 |
void SearchFilePathTest::searchTest(void) { |
| 22 |
|
| 23 |
std::vector<std::string> try_path; |
| 24 |
try_path.push_back("."); |
| 25 |
try_path.push_back(".."); |
| 26 |
|
| 27 |
std::string full_path; |
| 28 |
bool ret = searchFilePath(full_path, "ChangeLog", try_path); |
| 29 |
CPPUNIT_ASSERT_EQUAL(true, ret); |
| 30 |
CPPUNIT_ASSERT_EQUAL(std::string("../ChangeLog"), full_path); |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
void SearchFilePathTest::replaceTest(void) { |
| 35 |
|
| 36 |
// ~/.beego/beegoconf がないと、テストに失敗する |
| 37 |
std::vector<std::string> try_path; |
| 38 |
try_path.push_back("~/.beego"); |
| 39 |
std::string full_path; |
| 40 |
bool ret = searchFilePath(full_path, "beegoconf", try_path); |
| 41 |
CPPUNIT_ASSERT_EQUAL(true, ret); |
| 42 |
} |
|