image_page_unittest.cpp File Reference

#include <cassert>
#include <iostream>
#include "image_page.h"
#include "log.h"
Include dependency graph for image_page_unittest.cpp:

Go to the source code of this file.

Functions

int main ()

Function Documentation

int main (  ) 

Definition at line 34 of file image_page_unittest.cpp.

References Clockwise_Degrees_270, Clockwise_Degrees_90, images::ImagePage::length(), LOGPRINTF, images::ImagePageAttrs::rotation, and images::ImagePageAttrs::zoom.

00035 {
00036     ImagePage *page, *left_page, *right_page;
00037 
00038     LOGPRINTF("====BEGIN test operator()====");
00039     ImagePageAttrs attrs;
00040     page = new ImagePage("/data/wa/uds/trunk/sample/Vatican1.png", attrs);
00041     size_t key = (*page)();
00042     LOGPRINTF("key = %d", key);
00043     delete page;
00044 
00045     LOGPRINTF("Change render attributes.");
00046     attrs.zoom = -1;
00047     attrs.rotation = Clockwise_Degrees_90;
00048     page = new ImagePage("/data/wa/uds/trunk/sample/Vatican1.png", attrs);
00049     key = (*page)();
00050     LOGPRINTF("key = %d", key);
00051     delete page;
00052 
00053     LOGPRINTF("Changing the anchor.");
00054     page = new ImagePage("/data/wa/uds/trunk/sample/Vatican2.png", attrs);
00055     key = (*page)();
00056     LOGPRINTF("key = %d", key);
00057 
00058     LOGPRINTF("No changes.");
00059     key = (*page)();
00060     LOGPRINTF("key = %d", key);
00061     delete page;
00062     LOGPRINTF("====END test operator()====");
00063 
00064     LOGPRINTF("====BEGIN test operator ==  < > ====");
00065     attrs.zoom = -2;
00066     attrs.rotation = Clockwise_Degrees_270;
00067     left_page = new ImagePage("/data/wa/uds/trunk/sample/Pisa1.png", attrs);
00068     attrs.zoom = -2;
00069     attrs.rotation = Clockwise_Degrees_270;
00070     right_page = new ImagePage("/data/wa/uds/trunk/sample/Pisa1.png", attrs);
00071    
00072     LOGPRINTF("== %d", (left_page == right_page));
00073     LOGPRINTF("< %d", (left_page < right_page));
00074     LOGPRINTF("> %d", (left_page > right_page));
00075     delete left_page;
00076     delete right_page;
00077     LOGPRINTF("====END test operator==< > ====");
00078 
00079     LOGPRINTF("====BEGIN test length()====");
00080     page = new ImagePage("/data/wa/uds/trunk/sample/Pisa1.png", attrs);
00081     LOGPRINTF("page.length = %d", page->length());
00082     delete page;
00083     LOGPRINTF("====END test operator length()====");
00084 
00085     return 0;
00086 }

Here is the call graph for this function:

Generated by  doxygen 1.6.2-20100208