Scroom  0.14
test-helpers.hh File Reference
#include <boost/shared_ptr.hpp>
#include <gtk/gtk.h>
#include <scroom/colormappable.hh>
#include <scroom/layeroperations.hh>
#include "measure-framerate-stubs.hh"
Include dependency graph for test-helpers.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  DummyColormapProvider
 
class  TestData
 
class  Sleeper
 

Functions

bool quit ()
 
bool reset ()
 
bool wait ()
 
bool setupTest1bpp (int zoom, int width, int height)
 
bool setupTest2bpp (int zoom, int width, int height)
 
bool setupTest4bpp (int zoom, int width, int height)
 
bool setupTest8bpp (int zoom, int width, int height)
 
bool setupTest8bppColormapped (int zoom, int width, int height)
 

Variables

int drawingAreaWidth
 
int drawingAreaHeight
 
TestData::Ptr testData
 

Function Documentation

◆ quit()

bool quit ( )
121 {
122  gtk_main_quit();
123 
124  return false;
125 }

Referenced by init_tests().

Here is the caller graph for this function:

◆ reset()

bool reset ( )
128 {
129  testData.reset();
130 
131  return false;
132 }

Referenced by init_tests().

Here is the caller graph for this function:

◆ setupTest1bpp()

bool setupTest1bpp ( int  zoom,
int  width,
int  height 
)
147 {
150 
151  LayerSpec ls;
152  ls.push_back(Operations1bpp::create(colormapProvider));
153  ls.push_back(Operations8bpp::create(colormapProvider));
154 
155  TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
156  SourcePresentation::Ptr const sp(new Source1Bpp());
157  tbi->setSource(sp);
158 
159  testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
160 
161  return false;
162 }

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTest2bpp()

bool setupTest2bpp ( int  zoom,
int  width,
int  height 
)
165 {
168 
169  LayerSpec ls;
170  ls.push_back(Operations::create(colormapProvider, 2));
171  ls.push_back(OperationsColormapped::create(colormapProvider, 2));
172 
173  TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
174  SourcePresentation::Ptr const sp(new Source2Bpp());
175  tbi->setSource(sp);
176 
177  testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
178 
179  return false;
180 }

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTest4bpp()

bool setupTest4bpp ( int  zoom,
int  width,
int  height 
)
183 {
186 
187  LayerSpec ls;
188  ls.push_back(Operations::create(colormapProvider, 4));
189  ls.push_back(OperationsColormapped::create(colormapProvider, 4));
190 
191  TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
192  SourcePresentation::Ptr const sp(new Source4Bpp());
193  tbi->setSource(sp);
194 
195  testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
196 
197  return false;
198 }

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTest8bpp()

bool setupTest8bpp ( int  zoom,
int  width,
int  height 
)
201 {
204 
205  LayerSpec ls;
206  ls.push_back(Operations8bpp::create(colormapProvider));
207 
208  TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
209  SourcePresentation::Ptr const sp(new Source8Bpp());
210  tbi->setSource(sp);
211 
212  testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
213 
214  return false;
215 }

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTest8bppColormapped()

bool setupTest8bppColormapped ( int  zoom,
int  width,
int  height 
)
218 {
221 
222  LayerSpec ls;
223  ls.push_back(Operations::create(colormapProvider, 8));
224  ls.push_back(OperationsColormapped::create(colormapProvider, 8));
225 
226  TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
227  SourcePresentation::Ptr const sp(new Source8Bpp());
228  tbi->setSource(sp);
229 
230  testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
231 
232  return false;
233 }

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait()

bool wait ( )
135 {
136  if(testData)
137  {
138  return testData->wait();
139  }
140 
141  return false;
142 }

Referenced by init_tests().

Here is the caller graph for this function:

Variable Documentation

◆ drawingAreaHeight

int drawingAreaHeight

◆ drawingAreaWidth

int drawingAreaWidth

◆ testData

Colormap::createDefault
static Colormap::Ptr createDefault(int n)
Definition: colormappable.hh:51
createTiledBitmap
TiledBitmapInterface::Ptr createTiledBitmap(int bitmapWidth, int bitmapHeight, LayerSpec const &ls)
Definition: tiled-bitmap.cc:28
Operations8bpp::create
static Ptr create(ColormapProvider::Ptr colormapProvider)
Definition: layeroperations.cc:378
TestData::create
static Ptr create(DummyColormapProvider::Ptr colormapProvider, const LayerSpec &ls, const TiledBitmapInterface::Ptr &tbi, SourcePresentation::Ptr sp, int zoom)
Definition: test-helpers.cc:59
Operations1bpp::create
static Ptr create(ColormapProvider::Ptr colormapProvider)
Definition: layeroperations.cc:262
DummyColormapProvider::Ptr
boost::shared_ptr< DummyColormapProvider > Ptr
Definition: test-helpers.hh:27
SourcePresentation::Ptr
boost::shared_ptr< SourcePresentation > Ptr
Definition: tiledbitmapinterface.hh:198
LayerSpec
std::vector< LayerOperations::Ptr > LayerSpec
Definition: tiledbitmapinterface.hh:190
testData
TestData::Ptr testData
Definition: test-helpers.cc:25
Colormap::Ptr
boost::shared_ptr< Colormap > Ptr
Definition: colormappable.hh:31
colormap
const Colormap::Ptr colormap
Definition: colormaphelpers_test.cc:54
Operations::create
static Ptr create(ColormapProvider::Ptr colormapProvider, int bpp)
Definition: layeroperations.cc:574
OperationsColormapped::create
static Ptr create(ColormapProvider::Ptr colormapProvider, int bpp)
Definition: layeroperations.cc:723
Source1Bpp
Definition: measure-framerate-stubs.hh:71
DummyColormapProvider::create
static Ptr create(Colormap::Ptr colormap)
Definition: test-helpers.cc:34
Source2Bpp
Definition: measure-framerate-stubs.hh:79
TiledBitmapInterface::Ptr
boost::shared_ptr< TiledBitmapInterface > Ptr
Definition: tiledbitmapinterface.hh:239
Source8Bpp
Definition: measure-framerate-stubs.hh:95
Source4Bpp
Definition: measure-framerate-stubs.hh:87