27 #include <blackboard/local.h>
28 #include <blackboard/exceptions.h>
29 #include <blackboard/bbconfig.h>
31 #include <interfaces/TestInterface.h>
33 #include <core/exceptions/system.h>
43 using namespace fawkes;
49 signal_handler(
int signum)
56 main(
int argc,
char **argv)
59 signal(SIGINT, signal_handler);
69 cout <<
"Opening interfaces.. " << flush;
72 cout <<
"success, " <<
76 cout <<
"failed! Aborting" << endl;
82 <<
"Running data tests =================================================="
85 cout <<
"Writing initial value ("
86 << TestInterface::TEST_CONSTANT <<
") into interface as TestInt" << endl;
91 cout <<
"BUG: caught write denied exception" << endl;
95 cout <<
"Reading value from reader interface.. " << flush;
98 if ( val == TestInterface::TEST_CONSTANT ) {
99 cout <<
" success, value is " << ti_reader->
test_int() <<
" as expected" << endl;
101 cout <<
" failure, value is " << ti_reader->
test_int() <<
", expected "
102 << TestInterface::TEST_CONSTANT << endl;
105 cout <<
"Resizing buffer.. " << flush;
110 cout <<
"ERROR: Resizing failed, exception follows" << endl;
116 cout <<
"Testing buffers, use Ctrl-C to interrupt" << endl
117 <<
"If you do not see any output everything is fine" << endl;
126 cout <<
"BUG: caught write denied exception" << endl;
138 if ( rval != wval ) {
139 cout <<
" failure, reader value is " << rval <<
", writer has "
143 if ( rval != bval + 1 ) {
144 cout <<
" failure, reader value is " << rval <<
", buffer has "
157 cout <<
"Tests done" << endl;
159 bb->
close(ti_reader);
160 bb->
close(ti_writer);