예제 #1
0
파일: testfiles.cpp 프로젝트: GNOME/niepce
TEST(testFiles, testFilesSanity)
{
  fwk::utils::init();

  system("mkdir -p AAtest/sub");
  system("touch AAtest/1");
  system("touch AAtest/2");
  system("touch AAtest/3");

  FileList::Ptr files;

  files = FileList::getFilesFromDirectory("foo", fwk::filter_none);
  ASSERT_FALSE(files);

  files = FileList::getFilesFromDirectory("AAtest", fwk::filter_none);
  ASSERT_TRUE(files);
  ASSERT_EQ(files->size(), 3U);

  system("rm -fr AAtest");
}
예제 #2
0
int test_main( int, char *[] )             // note the name!
{
  fwk::utils::init();

	system( "mkdir -p AAtest/sub" );
	system( "touch AAtest/1" );
	system( "touch AAtest/2" );
	system( "touch AAtest/3" );

	FileList::Ptr files;
	
	files = FileList::getFilesFromDirectory("foo", fwk::filter_none);
	BOOST_CHECK( !files );

	files = FileList::getFilesFromDirectory("AAtest", fwk::filter_none);
	BOOST_CHECK( files );
	BOOST_CHECK( files->size() == 3 );
	
	system( "rm -fr AAtest" );
	return 0;
}