Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

Commit

Permalink
Added a method to initialize the OpenGLImage loader directly
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcox committed Jan 14, 2010
1 parent 96b669e commit e9975de
Show file tree
Hide file tree
Showing 34 changed files with 67 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "DummyEventTransport.h"
#include "IPCEventTransport.h"

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CodecAwareConduitTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CodecAwareConduitTestFixture, "Unit Test" );

using namespace mw;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

using namespace mw;

////<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( EventStreamConduitTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( EventStreamConduitTestFixture, "Unit Test" );


void EventStreamConduitTestFixture::setUp(){
Expand Down
2 changes: 1 addition & 1 deletion Core/Communications/Conduits/tests/SimpleConduitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SimpleConduitTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SimpleConduitTestFixture, "Unit Test" );

void SimpleEventCollector::handleEvent(shared_ptr<Event> event){
boost::mutex::scoped_lock lock(last_event_lock);
Expand Down
2 changes: 1 addition & 1 deletion Core/Communications/PythonConduitServerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using namespace mw;

////<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( PythonConduitServerTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( PythonConduitServerTestFixture, "Unit Test" );


void PythonConduitServerTestFixture::setUp(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <boost/archive/text_oarchive.hpp>
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SerializationTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SerializationTestFixture, "Unit Test" );


void SerializationTestFixture::setUp(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "IPCEventTransport.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( IPCEventTransportTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( IPCEventTransportTestFixture, "Unit Test" );


void IPCEventTransportTestFixture::testOneThread(){
Expand Down
2 changes: 1 addition & 1 deletion Core/DataFiles/tests/DataFileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace mw;
#define BUFFER_HIGH_WATER_MARK 1
#define MAX_EVENTS_TO_BUFFER 10000

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( DatumFileTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( DatumFileTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( DatumFileTestFixture );

#define dft_CPPUNIT_ASSERT_TS(x) dft_cppunit_lock->lock(); \
Expand Down
2 changes: 1 addition & 1 deletion Core/Events/tests/BufferManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void bmt_assert(const std::string &message,
const bool assertCondition);
//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( BufferManagerTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( BufferManagerTestFixture, "Unit Test" );
void BufferManagerTestFixture::setUp() {
shared_ptr <Clock> shared_clock = Clock::instance(false);
Expand Down
2 changes: 1 addition & 1 deletion Core/Events/tests/ScarabEventTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "EventBuffer.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScarabEventTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScarabEventTestFixture, "Unit Test" );

void ScarabEventTestFixture::setUp(){

Expand Down
2 changes: 1 addition & 1 deletion Core/GenericStructures/tests/ExpandableListTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using namespace mw;


//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ExpandableListTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ExpandableListTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( ExpandableListTestFixture );

void ExpandableListTestFixture::setUp(){}
Expand Down
2 changes: 1 addition & 1 deletion Core/GenericStructures/tests/LinkedListTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "LinkedListTest.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( LinkedListTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( LinkedListTestFixture, "Unit Test" );

void LinkedListTestFixture::setUp(){
a = shared_ptr<StimulusNode>(new StimulusNode());
Expand Down
2 changes: 1 addition & 1 deletion Core/Interpreters/tests/PerlInterpreterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#include "PerlInterpreterTest.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( PerlInterpreterTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( PerlInterpreterTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( PerlInterpreterTestFixture );
2 changes: 1 addition & 1 deletion Core/ParadigmComponents/tests/ActionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "CancelScheduledActionsAction.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ActionTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ActionTestFixture, "Unit Test" );

void ActionTestFixture::testSimpleAssignment1() {
shared_ptr<ConstantVariable>c1 = shared_ptr<ConstantVariable>(new ConstantVariable(Datum(M_FLOAT, 7.62)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using namespace mw;


//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( PlatformDependentServicesTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( PlatformDependentServicesTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( PlatformDependentServicesTestFixture );


Expand Down
2 changes: 1 addition & 1 deletion Core/RealtimeServices/tests/ClockTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "Clock.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ClockTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ClockTestFixture, "Unit Test" );

void ClockTestFixture::setUp() {
shared_ptr <Clock> shared_clock = Clock::instance(false);
Expand Down
16 changes: 14 additions & 2 deletions Core/RealtimeServices/tests/SchedulerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace mw;


//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SchedulerTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SchedulerTestFixture, "Unit Test" );

void SchedulerTestFixture::setUp() {
shared_ptr <Scheduler> shared_scheduler = Scheduler::instance(false);
Expand Down Expand Up @@ -352,7 +352,19 @@ void SchedulerTestFixture::reportLatencies(std::vector<MWTime> times_array,
}
n++;
}


#define DO_CUMULATIVE 1
if(DO_CUMULATIVE){
less_than_10us += less_than_5us;
less_than_50us += less_than_10us;
less_than_100us += less_than_50us;
less_than_500us += less_than_100us;
less_than_1000us += less_than_500us;
less_than_5000us += less_than_1000us;
less_than_10000us += less_than_5000us;
less_than_15000us += less_than_10000us;
}

fprintf(stderr, "Latency Statistics...\n"
"\t< 5us: %.4g\n"
"\t< 10us: %.4g\n"
Expand Down
12 changes: 6 additions & 6 deletions Core/RealtimeServices/tests/SchedulerTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace mw {
#define N_SCHEDULED_EXECUTIONS 100
#define SLACK_MARGIN 5
#define ACCEPTABLE_ERROR_US 10000 // 10 ms
#define ACCEPTABLE_ERROR_US 1000 // 100 us

void *chaff_1(const MWTime interval);

Expand All @@ -37,12 +37,12 @@ class SchedulerTestFixture : public FullCoreEnvironmentTestFixture {

CPPUNIT_TEST_SUITE( SchedulerTestFixture );

// CPPUNIT_TEST( testPeriod10HzNoPayload );
// CPPUNIT_TEST( testPeriod100HzNoPayload );
// CPPUNIT_TEST( testPeriod10HzNoPayloadChaffX4 );
CPPUNIT_TEST( testPeriod10HzNoPayload );
CPPUNIT_TEST( testPeriod100HzNoPayload );
CPPUNIT_TEST( testPeriod10HzNoPayloadChaffX4 );
//CPPUNIT_TEST( testPeriod10HzNoPayloadChaffX20 );
// CPPUNIT_TEST( testPeriod10HzSmallPayload );
// CPPUNIT_TEST( testOneOffFiringSmallPayload );
CPPUNIT_TEST( testPeriod10HzSmallPayload );
CPPUNIT_TEST( testOneOffFiringSmallPayload );

CPPUNIT_TEST (testSchedulerLeaks);

Expand Down
2 changes: 1 addition & 1 deletion Core/RealtimeServices/tests/TimerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "MonkeyWorksCore/TrialBuildingBlocks.h"
#include "MonkeyWorksCore/GlobalVariable.h"

////<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TimerTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TimerTestFixture, "Unit Test" );


#include <mach/mach_types.h>
Expand Down
2 changes: 1 addition & 1 deletion Core/Scarab/tests/ScarabDataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#include "ScarabDataTest.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScarabDataTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScarabDataTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( ScarabDataTestFixture );
2 changes: 1 addition & 1 deletion Core/Scarab/tests/ScarabFileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#include "ScarabFileTest.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScarabFileTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScarabFileTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( ScarabFileTestFixture );
2 changes: 1 addition & 1 deletion Core/Scarab/tests/ScarabNetworkTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#include "ScarabNetworkTest.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScarabNetworkTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScarabNetworkTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( ScarabNetworkTestFixture );
26 changes: 15 additions & 11 deletions Core/Stimuli/StandardStimuli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,20 @@ shared_ptr<mw::Component> BlankScreenFactory::createObject(std::map<std::string,
bool OpenGLImageLoader::initialized = false;
Lockable *OpenGLImageLoader::lock = NULL;

void OpenGLImageLoader::initialize(){
mprintf("initializing image loader facility");
OpenGLImageLoader::lock = new Lockable();
lock = OpenGLImageLoader::lock;

//lock->lock();
ilInit();
ilutInit();
ilutRenderer(ILUT_OPENGL);
ilutEnable(ILUT_OPENGL_CONV);
//lock->unlock();
OpenGLImageLoader::initialized = true;
}

GLuint OpenGLImageLoader::load(std::string filename, StimulusDisplay *display,
int *width, int *height) {

Expand Down Expand Up @@ -785,17 +799,7 @@ GLuint OpenGLImageLoader::load(std::string filename, StimulusDisplay *display,
fclose(test);

if(1 || !OpenGLImageLoader::initialized) {
mprintf("initializing image loader facility");
OpenGLImageLoader::lock = new Lockable();
lock = OpenGLImageLoader::lock;

//lock->lock();
ilInit();
ilutInit();
ilutRenderer(ILUT_OPENGL);
ilutEnable(ILUT_OPENGL_CONV);
//lock->unlock();
OpenGLImageLoader::initialized = true;
OpenGLImageLoader::initialize();
}


Expand Down
3 changes: 2 additions & 1 deletion Core/Stimuli/StandardStimuli.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ class OpenGLImageLoader {
static bool initialized;
static Lockable *lock;

static GLuint load(std::string filename, StimulusDisplay *display,
static void initialize();
static GLuint load(std::string filename, StimulusDisplay *display,
int *width, int *height);
};

Expand Down
2 changes: 1 addition & 1 deletion Core/Triggers/tests/TriggerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#include "TriggerTest.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TriggerTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TriggerTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( TriggerTestFixture );
2 changes: 1 addition & 1 deletion Core/Utilities/tests/RegisteredSingletonTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SINGLETON_INSTANCE_STATIC_DECLARATION(Dummy)

#define NUMBER_OF_SINGLETON_TEST_LOOPS 10

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( RegisteredSingletonTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( RegisteredSingletonTestFixture, "Unit Test" );

void RegisteredSingletonTestFixture::setUp() {
boost::shared_ptr <Dummy> dummy_instance = Dummy::instance(false);
Expand Down
2 changes: 1 addition & 1 deletion Core/Variables/tests/GenericDataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "GenericDataTest.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( GenericDataTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( GenericDataTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( GenericDataTestFixture );


Expand Down
2 changes: 1 addition & 1 deletion Core/Variables/tests/ParsedExpressionVariableTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "EventBuffer.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ParsedExpressionVariableTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ParsedExpressionVariableTestFixture, "Unit Test" );

void ParsedExpressionVariableTestFixture::testSimpleExpression() {

Expand Down
2 changes: 1 addition & 1 deletion Core/Variables/tests/ScopedVariableTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using namespace mw;


//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScopedVariableTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ScopedVariableTestFixture, "Unit Test" );

void ScopedVariableTestFixture::setUp(){
FullCoreEnvironmentTestFixture::setUp();
Expand Down
2 changes: 1 addition & 1 deletion Core/Variables/tests/SelectionVariableTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "Clock.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SelectionVariableTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SelectionVariableTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( SelectionVariableTestFixture );


Expand Down
2 changes: 1 addition & 1 deletion Core/Variables/tests/VariablePropertiesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "EventBuffer.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VariablePropertiesTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VariablePropertiesTestFixture, "Unit Test" );

void VariablePropertiesTestFixture::setUp(){
// Create a variable registry
Expand Down
2 changes: 1 addition & 1 deletion Core/Variables/tests/VariableTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "TrialBuildingBlocks.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VariableTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VariableTestFixture, "Unit Test" );

void VariableTestFixture::testSimpleConstant() {
Datum seven_point_six_two(M_FLOAT, 7.62);
Expand Down
2 changes: 1 addition & 1 deletion Core/Variables/tests/VectorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#include "VectorTest.h"
using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VectorTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VectorTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( VectorTestFixture );
2 changes: 1 addition & 1 deletion Core/XMLParser/XMLParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "MonkeyWorksCore/VariableSave.h"


//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( mw::XMLParserTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( mw::XMLParserTestFixture, "Unit Test" );

void mw::XMLParserTestFixture::setUp() {
mw::FullCoreEnvironmentTestFixture::setUp();
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/BoostMathExampleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using namespace mw;

//<disabled>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( BoostMathExampleTestFixture, "Unit Test" );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( BoostMathExampleTestFixture, "Unit Test" );
//CPPUNIT_TEST_SUITE_REGISTRATION( BoostMathExampleTestFixture );


Expand Down

0 comments on commit e9975de

Please sign in to comment.