]>
git.saurik.com Git - wxWidgets.git/blob - tests/misc/pathlist.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/misc/pathlist.cpp
3 // Purpose: Test wxPathList
4 // Author: Francesco Montorsi (extracted from console sample)
7 // Copyright: (c) 2010 wxWidgets team
8 ///////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
20 #include "wx/filefn.h"
22 // ----------------------------------------------------------------------------
24 // ----------------------------------------------------------------------------
26 class PathListTestCase
: public CppUnit::TestCase
29 PathListTestCase() { }
32 CPPUNIT_TEST_SUITE( PathListTestCase
);
33 CPPUNIT_TEST( FindValidPath
);
34 CPPUNIT_TEST_SUITE_END();
38 DECLARE_NO_COPY_CLASS(PathListTestCase
)
41 // register in the unnamed registry so that these tests are run by default
42 CPPUNIT_TEST_SUITE_REGISTRATION( PathListTestCase
);
44 // also include in its own registry so that these tests can be run alone
45 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( PathListTestCase
, "PathListTestCase" );
47 void PathListTestCase::FindValidPath()
50 #define CMD_IN_PATH wxT("ls")
52 #define CMD_IN_PATH wxT("cmd.exe")
56 pathlist
.AddEnvList(wxT("PATH"));
58 wxString path
= pathlist
.FindValidPath(CMD_IN_PATH
);
59 CPPUNIT_ASSERT( !path
.empty() );