test_filenames.cpp File Reference

Tester that tries to feed a lot of possible characters as filenames into the makefilelib, make, and the filesystem. More...

#include "char_type.h"
#include "Comment.h"
#include "Variable.h"
#include "VariableDef.h"
#include "VariableRef.h"
#include "MakefileItem.h"
#include "Makefile.h"
#include "AutoVariable.h"
#include "Newline.h"
#include "Rule.h"
#include "Conditional.h"
#include "StringAdapter.h"
#include "test_util.h"
#include <iostream>
#include <vector>

Include dependency graph for test_filenames.cpp:

Go to the source code of this file.

Defines

#define START   0x20

Functions

void printchars (ostream &out, wchar_t limit)
 Prints the tested characters.
std::vector< pathcreatefiles_direct (const path dir, uchar_type limit)
 Tries to create files with names from 0x20 to limit using boost::filesystem.
std::vector< pathcreatefiles_make (const path dir, uchar_type limit)
 Tries to create files with names from 0x20 to limit by calling make.
int cleandir (path dir)
 Removes and recreates the output directories.
void printmiss (std::vector< path >::iterator start, std::vector< path >::iterator end)
int main (int argc, char *argv[])

Variables

ostreamcout = std::cout
ostreamcerr = std::cerr


Detailed Description

Tester that tries to feed a lot of possible characters as filenames into the makefilelib, make, and the filesystem.

Created on: Jul 16, 2010

Author:
Florian Achleitner <florian.achleitner.2.6.31@gmail.com>

Definition in file test_filenames.cpp.


Define Documentation

#define START   0x20

Definition at line 58 of file test_filenames.cpp.

Referenced by createfiles_direct(), createfiles_make(), and main().


Function Documentation

int cleandir ( path  dir  ) 

Removes and recreates the output directories.

Parameters:
dir 
Returns:
0 on success, 1 on error.

Definition at line 159 of file test_filenames.cpp.

References cerr, and cstr.

Referenced by main().

std::vector<path> createfiles_direct ( const path  dir,
uchar_type  limit 
)

Tries to create files with names from 0x20 to limit using boost::filesystem.

Parameters:
dir 
limit Upper limit for filenames
Returns:
Filenames that couldn't be found after creation.

Definition at line 80 of file test_filenames.cpp.

References cstr, and START.

Referenced by main().

std::vector<path> createfiles_make ( const path  dir,
uchar_type  limit 
)

Tries to create files with names from 0x20 to limit by calling make.

It first writes a makefile of this structure:

FILENAME=X.1

all :
@touch $(FILENAME)
Afterwards make is called with system() and creates the file by executing touch.

Parameters:
dir 
limit Upper limit for filenames
Returns:
Filenames that couldn't be found after creation.

Definition at line 111 of file test_filenames.cpp.

References makefile::MakefileItem::add(), makefile::Rule::addCommand(), makefile::Rule::addTarget(), cerr, cout, cstr, makefile::tester::exec_make(), makefile::Variable::getDef(), makefile::Variable::getRef(), makefile::Makefile::SHELL, START, and makefile::VariableRef::toString().

Referenced by main().

int main ( int  argc,
char *  argv[] 
)

Definition at line 182 of file test_filenames.cpp.

References cerr, cleandir(), cout, createfiles_direct(), createfiles_make(), cstr, printmiss(), and START.

void printchars ( ostream out,
wchar_t  limit 
)

Prints the tested characters.

Parameters:
out 
limit 

Definition at line 65 of file test_filenames.cpp.

void printmiss ( std::vector< path >::iterator  start,
std::vector< path >::iterator  end 
)

Definition at line 171 of file test_filenames.cpp.

References cout, and cstr.

Referenced by main().


Variable Documentation

ostream& cerr = std::cerr

Definition at line 55 of file test_filenames.cpp.

Referenced by lfeat::CircularKeyPointDescriptor::assignOrientation(), checkFramebufferStatus(), checkGLErrors(), cleandir(), compileGLSL(), Ransac::compute(), createCtrlPointsOld(), createfiles_make(), DetectKeypoints(), RunStitchPanel::DetectProject(), HuginBase::AutoOptimise::OptimiseVisitor::discover_vertex(), makefile::tester::exec_make(), MyOutput::failure(), celeste::FileCreateError(), celeste::FileOpenError(), celeste::GaborJet::Filter(), getPTLensCoef(), ProgressReporterDialog::increaseProgress(), initGPU(), HuginBase::SrcPanoImage::isCircularCrop(), loadAndConvertImage(), LoadGrayImageAndFindLines(), LoadImageAndFindLines(), LoadLensParametersChoose(), PanoDetector::loadProject(), main(), main2(), mergeWeightedAverage(), vigra_ext::nearestFeatureTransform(), iCPApp::OnRun(), OptimData::OptimData(), HuginBase::PTools::optimize(), parseOptions(), parseOptions_advanced(), parseOptions_save(), processImg(), PT::wxAddImagesCmd::processPanorama(), processPTO(), celeste::PGMImage::Read(), makefile::Makefile::remove(), ProgressReporterDialog::setMessage(), HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::MultiImageRemapper< vigra::FRGBImage, AlphaImageType >::stitch(), RunStitchPanel::StitchProject(), vigra_ext::transformImageAlphaGPUIntern(), tryall(), UpdateSingleVar(), usage(), work_on_triplets(), and PanoDetector::writeOutput().

ostream& cout = std::cout

Definition at line 54 of file test_filenames.cpp.

Referenced by autoCrop(), PanoDetector::checkData(), TextureManager::CheckUpdate(), convert_file(), CPMessage(), createCtrlPoints(), createfiles_make(), deghosting::Khan< PixelType >::createWeightMasks(), KDTreeSpace::HyperRectangle< KE, TYPE >::display(), TestCode::drawRansacMatches(), MyExecPanel::ExecWithRedirect(), getPTLensCoef(), celeste::GetStreamDefaults(), initGPU(), KDTreeSpace::HyperRectangle< KE, TYPE >::isTargetIn(), Batch::ListBatch(), HuginBase::LensDB::LensDB::LoadFilesInDir(), loadImagesPyr(), PT::loadImagesPyr(), PanoDetector::LoadSVMModel(), celeste::loadSVMmodel(), main(), main2(), mergeWeightedAverage(), CPEditorPanel::OnCelesteButton(), stitchApp::OnInit(), iCPApp::OnRun(), PluginItem::ParseMetadata(), parseOptions(), celeste::prepareCelesteImage(), PanoDetector::printDetails(), PanoDetector::printFilenames(), printInfoLog(), printmiss(), HuginBase::printstacks(), printUsage(), printVersion(), PanoDetector::run(), makefile::tester::Test::run(), SetGeometricControlPointsOverlap(), SetGeometricControlPointsUnconnected(), HuginBase::ImageCache::softFlush(), vigra_ext::transformImageAlphaGPUIntern(), vigra_ext::transformImageGPUIntern(), UpdateSingleVar(), MyOutput::usage(), usage(), MyOutput::version(), weightedAverageOfImageFiles(), and work_on_triplets().


Generated on 21 Nov 2014 for Hugintrunk by  doxygen 1.4.7