Created
November 7, 2014 02:19
-
-
Save el3ment/a6f85e5c3fed8b1a76b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start the module | |
// Fake a state | |
// Wait for the module to publish it's response | |
// Check to see if that response was expected | |
// Fake a new state and do it again. | |
// End the module | |
State testArray = [ | |
{sensors : {pos, barometer, gps...}, controls : {control1, control2}}, | |
{sensors : {pos, barometer, gps...}, controls : {control1, control2}}] | |
attitude_estimator_module.start(); | |
attitudeControlSubscriber = subscribe(attitudeControl); | |
foreach(testArray as test){ | |
waitingForData = true; | |
// Fake all of the sensor states | |
foreach(test.sensors as sensorData){ | |
broadcast(sensorId, sensorData); | |
} | |
// Wait for control module to publish it's response | |
while(waitingForData){ | |
// It's published | |
if(attitudeControlSubscriber.isUpdated()) | |
// Check to see if it matches | |
assert(attitudeControlSubscriber.data == test.controls.attitudeControl); | |
waitingForData = false; | |
} | |
} | |
} | |
attitude_estimator_module.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment