Fixed bug, checking single file was not possible. Few new tests added also
This commit is contained in:
parent
a86b07ed17
commit
36b820491f
|
@ -113,13 +113,8 @@ void FileLister::RecursiveAddFiles( std::vector<std::string> &filenames, const s
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << path;
|
oss << path;
|
||||||
if( recursive )
|
if ( path.length() > 0 && path[path.length()-1] == '/' )
|
||||||
{
|
|
||||||
if ( path.length() > 0 && path[path.length()-1] != '/' )
|
|
||||||
oss << "/";
|
|
||||||
|
|
||||||
oss << "*";
|
oss << "*";
|
||||||
}
|
|
||||||
|
|
||||||
glob_t glob_results;
|
glob_t glob_results;
|
||||||
glob( oss.str().c_str(), GLOB_MARK, 0, &glob_results);
|
glob( oss.str().c_str(), GLOB_MARK, 0, &glob_results);
|
||||||
|
@ -158,15 +153,9 @@ void FileLister::RecursiveAddFiles( std::vector<std::string> &filenames, const s
|
||||||
{
|
{
|
||||||
std::ostringstream bdir, oss;
|
std::ostringstream bdir, oss;
|
||||||
oss << path;
|
oss << path;
|
||||||
if (recursive)
|
bdir << path;
|
||||||
|
if ( path.length() > 0 && path[path.length()-1] == '/' )
|
||||||
{
|
{
|
||||||
bdir << path;
|
|
||||||
if ( path.length() > 0 && path[path.length()-1] != '/' )
|
|
||||||
{
|
|
||||||
bdir << "/";
|
|
||||||
oss << "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
oss << "*";
|
oss << "*";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ private:
|
||||||
TEST_CASE( virtualDestructor2 ); // Base class doesn't have a destructor
|
TEST_CASE( virtualDestructor2 ); // Base class doesn't have a destructor
|
||||||
TEST_CASE( virtualDestructor3 ); // Base class has a destructor, but it's not virtual
|
TEST_CASE( virtualDestructor3 ); // Base class has a destructor, but it's not virtual
|
||||||
TEST_CASE( virtualDestructor4 ); // Derived class doesn't have a destructor => no error
|
TEST_CASE( virtualDestructor4 ); // Derived class doesn't have a destructor => no error
|
||||||
|
TEST_CASE( virtualDestructor5 ); // Derived class has empty destructor => no error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that base classes have virtual destructors
|
// Check that base classes have virtual destructors
|
||||||
|
@ -110,6 +111,19 @@ private:
|
||||||
"class Derived : private Fred, public Base { };");
|
"class Derived : private Fred, public Base { };");
|
||||||
ASSERT_EQUALS( std::string(""), errout.str() );
|
ASSERT_EQUALS( std::string(""), errout.str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void virtualDestructor5()
|
||||||
|
{
|
||||||
|
// Derived class has empty destructor => no error
|
||||||
|
|
||||||
|
checkVirtualDestructor("class Base { public: ~Base(); };\n"
|
||||||
|
"class Derived : public Base { public: ~Derived() {} };");
|
||||||
|
ASSERT_EQUALS( std::string(""), errout.str() );
|
||||||
|
|
||||||
|
checkVirtualDestructor("class Base { public: ~Base(); };\n"
|
||||||
|
"class Derived : public Base { public: ~Derived(); }; Derived::~Derived() {}");
|
||||||
|
ASSERT_EQUALS( std::string(""), errout.str() );
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
REGISTER_TEST( TestClass )
|
REGISTER_TEST( TestClass )
|
||||||
|
|
Loading…
Reference in New Issue