2nd part of the project – testing at the function level (part 2)

August 14, 2010 at 9:18 am | Posted in Uncategorized | Leave a comment

Thanks to my mentor I have a list of functions that Hugin is using. It allows me to focus on the most important part of the project – writing the tests. And here is the list if someone needs it:
CheckParams
DisposeAlignInfo
distSquared
erect_albersequalareaconic
erect_mercator
erect_pano
erect_rect
erect_sinusoidal
erect_sphere_tp
erect_stereographic
erect_transmercator
execute_stack_new
GetFullPath
getROI
horiz
inv_radial
mercator_erect
merge
myfree
operator&lt
pano_erect
panoProjectionFeaturesQuery
panoProjectionFormatCount
pano_sphere_tp
ParseScript
persp_rect
persp_sphere
PrintError
PT_setErrorFcn
PT_setInfoDlgFcn
PT_setProgressFcn
queryFOVLimits
radial
rect_erect
rect_sphere_tp
resize
rotate_erect
RunLMOptimizer
SetAdjustDefaults
SetCoordDefaults
SetCorrectDefaults
SetCorrectionRadius
SetGlobalPtr
SetImageDefaults
SetInvMakeParams
SetMakeParams
SetMatrix
SetOptDefaults
SetStitchDefaults
sinusoidal_erect
sphere_tp_erect
sphere_tp_pano
sphere_tp_rect
stereographic_erect
StringtoFullPath
transmercator_erect
vert
WriteResults

I also resigned from using Boost Test Library simply because ctest is already handling the most of BTL tasks (it also needs to install Boost library etc.). Not every element (function) from the list above is needed to be tested, but much of them is very important. So we concentrated on two essencial areas: math/projection and optimization. A list of tested functions (they are already added into svn and integrated with cmake/ctest):

– Optimizer related functions:
* CheckParams
* distSquared
* RunLMOptimizer (this is the main function)

– Math/projection related functions:
* transmercator_erect
* erect_transmercator
* stereographic_erect
* erect_stereographic
* sinusoidal_erect
* erect_sinusoidal
* rect_erect
* erect_rect
* pano_erect
* erect_pano
* mercator_erect
* erect_mercator
* sphere_tp_erect
* erect_sphere_tp
* sphere_tp_pano
* pano_sphere_tp
* sphere_tp_rect
* rect_sphere_tp



2nd part of the project – testing at the function level

August 2, 2010 at 12:31 am | Posted in Uncategorized | Leave a comment

I must say it was very hard for me at the beginning to determine what functions are more important and what are less but over time I started to recognize that. I will use the Boost Test Library for unit testing, for organizing tests CTest form CMake would be better because the first part of this project was based on it. Why Boost Test Library?

  • it is rather mature and stable
  • it has many information and examples of its usage
  • it has all the options needed for automatic testing
  • it has many additional options which might be used in future tests development
  • almost everyone have boost library already in their computer, so no additional installations are needed

more info about BTL : http://www.boost.org/doc/libs/1_34_0/libs/test/doc/index.html

Now some more about the tests. Here is a list I made myself for marking the priority of the testing files in libpano (the more ‘+’ the more it is important to test):

  • adjust.c                +++
  • bmp.c                    +
  • ColourBrightness.c+++
  • correct.c            ++
  • dump.c                +
  • fftn.c                +
  • file.c                ++
  • filter.c                ++++
  • fourier.c            +
  • hdrfile.c            +
  • javastub.c            +
  • jpeg.c                +
  • jpegicc.c            +
  • lmdif.c                +
  • math.c                ++
  • metadata.c            +++
  • morpher.c            +
  • multilayer.c        +
  • optimize.c            +++
  • pan.c                    +
  • PaniniGeneral.c    +
  • parser.c                +
  • perspect.c            +
  • png.c                    +
  • ppm.c                    +
  • PTcommon.c            ++++
  • PTDialogs.c            +
  • pteditor.c            +
  • ptfeather.c            +++
  • ptpicker.c            ++
  • ptstitch.c            +++
  • queryfeature.c        ++
  • remap.c                ++
  • resample.c            ++
  • rgbe.c                +
  • seamer_.c            +
  • seamer.c                +
  • shell_mac.c            +
  • sys_ansi.c            +
  • sys_common.c        +
  • sys_mac.c            +
  • sys_win.c            +
  • sys_X11.c            +
  • tiff.c                +++
  • Triangulate.c        +
  • ZComb.c                +

That is quite a big list but it is almost impossible to test every function from this files fully. So it is important to choice wisely. And now a bit smaller list with functions I will test in the next days (or already started testing):

  • void ColourBrightness(  fullPath *fullPathImages, fullPath *outFullPathImages, int counterImages, int indexReferenceImage, int parm3,int createCurvesType)
  • void CorrectImageColourBrigthness(Image *image, magnolia_struct *magnolia, int parm3)
  • void filter( TrformStr *TrPtr, flfn func, flfn16 func16, void* params, int color)
  • int panoCroppingMain(int argc,char *argv[], int operation, char *version, char *usage, char *defaultPrefix)
  • int CropImage(Image *im, PTRect *r)
  • int readJPEG ( Image *im, fullPath *sfile )
  • int writeJPEG ( Image *im, fullPath *sfile,     int quality, int progressive )
  • int readTIFF ( Image *im, fullPath *sfile )
  • int writeTIFF ( Image *im, fullPath *fname)
  • int writeHDR ( Image *im, fullPath *sfile )
  • int readHDR ( Image *im, fullPath *sfile )
  • int blendImages ( fullPath *f0,  fullPath *f1, fullPath *result, double s )
  • int panoTiffDisplayInfo(char *fileName)
  • int panoCreatePanorama(fullPath ptrImageFileNames[], int counterImageFiles, fullPath * panoFileName, fullPath * scriptFileName)
  • void  RunLMOptimizer( OptInfo    *o)
  • int panoFlattenTIFF(fullPath *fullPathImages, int counterImageFiles, fullPath *outputFileName, int removeOriginals);
  • int panoPSDCreate(fullPath * fullPathImages, int numberImages, fullPath * outputFileName, pano_flattening_parms *flatteningParms)

This list isn’t full and might be changed over time.

Create a free website or blog at WordPress.com.
Entries and comments feeds.