Go to the documentation of this file.00001 #include "lsp_test_blobfinder.hh"
00002
00003 using namespace lspTest;
00004
00005 void Blobfinder::setUp() {
00006 connect();
00007 blobProxy = playerc_blobfinder_create( client, 0 );
00008 CPPUNIT_ASSERT( playerc_blobfinder_subscribe( blobProxy, PLAYER_OPEN_MODE ) == 0 );
00009 }
00010
00011
00012 void Blobfinder::tearDown() {
00013 CPPUNIT_ASSERT( playerc_blobfinder_unsubscribe( blobProxy ) == 0 );
00014 playerc_blobfinder_destroy( blobProxy );
00015 disconnect();
00016 }
00017
00018 void Blobfinder::testData() {
00019 playerc_client_read( client );
00020
00021
00022 blobProxy->info.fresh = 0;
00023 playerc_client_read( client );
00024 CPPUNIT_ASSERT_MESSAGE( "blobfinder updating", blobProxy->info.fresh == 1 );
00025
00026 CPPUNIT_ASSERT( blobProxy->info.datatime > 0 );
00027
00028
00029
00030
00031 CPPUNIT_ASSERT( blobProxy->width == 80 );
00032 CPPUNIT_ASSERT( blobProxy->height == 60 );
00033
00034
00035 CPPUNIT_ASSERT_EQUAL_MESSAGE( "blobs_count", (unsigned int)3, blobProxy->blobs_count );
00036
00037 CPPUNIT_ASSERT( blobProxy->blobs[1].range > 0 );
00038 CPPUNIT_ASSERT( blobProxy->blobs[1].area > 0 );
00039 CPPUNIT_ASSERT( blobProxy->blobs[1].y > 0 );
00040 CPPUNIT_ASSERT( blobProxy->blobs[1].left < blobProxy->blobs[1].right );
00041 CPPUNIT_ASSERT( blobProxy->blobs[1].top < blobProxy->blobs[1].bottom );
00042
00043
00044 CPPUNIT_ASSERT( blobProxy->blobs[1].color == 0xFFFF0000 );
00045
00046
00047 CPPUNIT_ASSERT( blobProxy->blobs[0].range > blobProxy->blobs[1].range );
00048
00049
00050 uint32_t robotCenter = blobProxy->blobs[1].x;
00051 uint32_t imageCenter = blobProxy->width / 2;
00052
00053 CPPUNIT_ASSERT( robotCenter > imageCenter );
00054
00055
00056
00057
00058
00059 }