Example #1
0
  void testPageStore(PageStore& uut)
  {
    CPPUNIT_ASSERT_EQUAL(0, uut.getPageCount());
    int pageSize = uut.getPageSize();

    boost::shared_ptr<Page> p = uut.createPage();
    CPPUNIT_ASSERT_EQUAL(pageSize, p->getDataSize());

    populatePage(p);
    verifyPage(p);

    
    _ids.push_back(p->getId());

    for (int i = 1; i < 100; i++)
    {
      CPPUNIT_ASSERT_EQUAL(i, uut.getPageCount());
      p = uut.createPage();
      populatePage(p);
      _ids.push_back(i);
    }
    CPPUNIT_ASSERT_EQUAL(100, uut.getPageCount());

    for (int i = 0; i < 100; i++)
    {
      p = uut.getPage(_ids[i]);
      verifyPage(p);
    }

    uut.save();

    for (int i = 0; i < 100; i++)
    {
      p = uut.getPage(_ids[i]);
      verifyPage(p);
    }

    uut.flush();

    for (int i = 0; i < 100; i++)
    {
      p = uut.getPage(_ids[i]);
      verifyPage(p);
    }
  }
/** greebo: Constructor creates all the widgets
 */
CustomStimEditor::CustomStimEditor(StimTypes& stimTypes) :
	Gtk::HBox(false, 12),
	_stimTypes(stimTypes),
	_updatesDisabled(false)
{
	populatePage();

	// Setup the context menu items and connect them to the callbacks
	createContextMenu();

	// The list may be empty, update the sensitivity
	update();

	show_all();
}