images_scanner_unittest.cpp File Reference

#include <iostream>
#include <glib.h>
#include <glib-object.h>
#include "images_scanner.h"
#include "log.h"
Include dependency graph for images_scanner_unittest.cpp:

Go to the source code of this file.

Functions

void test_ImagesScanner (void)
int main ()

Function Documentation

int main (  ) 

Definition at line 94 of file images_scanner_unittest.cpp.

References test_ImagesScanner().

00095 {
00096     test_ImagesScanner();
00097     return 0;
00098 }

Here is the call graph for this function:

void test_ImagesScanner ( void   ) 

Definition at line 35 of file images_scanner_unittest.cpp.

References LOGPRINTF, and path.

Referenced by main().

00036 {
00037     LOGPRINTF("BEGIN-->test_ImagesScanner");
00038 
00039     g_type_init();
00040 
00041     const char * path_list[] = {
00042     "/data/wa/uds/yehong/sample/rome.jpg",
00043 //    "/data/wa/uds/yehong/example1",
00044 //    "/data/wa/uds/yehong/example1/",
00045 //    "rome.jpg",
00046 //    "*.jpg",
00047 //    "/data/wa/uds/yehong/sample/",
00048 //    "/data/wa/uds/yehong/sample/a.b.c",
00049 //    "/data/wa/uds/yehong/sample",
00050 //    "*.*",
00051 //    ".",
00052 //    "./sample/c.b.a",
00053 //    "/data/wa/uds/trunk/sample/Pisa1.JPG",
00054 //    "/usr/share"
00055     };
00056    
00057     ImagesScanner scanner;
00058     Images images;
00059     
00060     int n_cases = sizeof(path_list) / sizeof(path_list[0]);
00061     for (int j = 0; j < n_cases; j++)
00062     {
00063         // Clear the last scan results.
00064         ImagesIter begin = images.begin();
00065         ImagesIter end   = images.end();
00066         for(ImagesIter iter = begin; iter != end; ++iter)
00067         {
00068             delete *iter;
00069         }
00070         images.clear();
00071 
00072         /*
00073         int n_active = scanner.scan_images(path_list[j],
00074                                            true,
00075                                            true, 
00076                                            BY_SIZE,
00077                                            false,
00078                                            images);
00079         LOGPRINTF("%d", n_active);
00080         */
00081         
00082         int n_images = images.size();
00083         LOGPRINTF("%d", n_images);
00084 
00085         for (int i = 0; i < n_images; i++)
00086         {
00087             LOGPRINTF("%s", images[i]->path.c_str());
00088         }
00089     }
00090 
00091     LOGPRINTF("END-->test_ImagesScanner");
00092 }

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208