NEW FILE HEADER / COPYRIGHT FORMAT
[senf.git] / Packets / MPEGDVBBundle / GREPacket.test.cc
index cdb59ba..676a828 100644 (file)
@@ -1,9 +1,9 @@
-// $Id$
+// $Id:GREPacket.test.cc 560 2007-12-13 14:39:37Z tho $
 //
 // Copyright (C) 2007
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-//     Joachim Kaeber <joachim.kaeber@fokus.fraunhofer.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS) 
+// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+//     Joachim Kaeber <jkaeber@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 
 // Unit tests
 
-//#include "TransportPacket.test.hh"
-//#include "TransportPacket.test.ih"
+//#include "GREPacket.test.hh"
+//#include "GREPacket.test.ih"
 
 // Custom includes
-#include "TransportPacket.hh"
+#include "GREPacket.hh"
 
 #include "../../Utils/auto_unit_test.hh"
 #include <boost/test/test_tools.hpp>
 
 using namespace senf;
 
-BOOST_AUTO_UNIT_TEST(transportPacket_packet)
+BOOST_AUTO_UNIT_TEST(GREPacket_packet)
 {
-    // TransportStream-Packet containing a ULE encoded IPv6 ping packet,
-    // captured with dvbsnoop
-    unsigned char data[] = { 
-            0x47, 0x41, 0x0f, 0x1e, 0x00, 0x80, 0x4c, 0x86,
-            0xdd, 0x60, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 
-            0x40, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
-            0x00, 0x48, 0x7c, 0x7e, 0xff, 0xfe, 0x23, 0x68,
-            0xaf, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
-            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
-            0x04 ,0x02, 0x8c, 0x02, 0x8c, 0x00, 0x20, 0x58,
-            0xe1, 0x11, 0x05, 0x12, 0x67, 0x06, 0x2f, 0x01,
-            0x00, 0x20, 0x01, 0x06, 0x38, 0x04, 0x09, 0x10,
-            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,
-            0x00, 0x1d, 0xc4, 0xe8, 0xc1, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-            0xff, 0xff, 0xff, 0xff
-    };
-            
-    senf::TransportPacket p (senf::TransportPacket::create(data));
+    senf::GREPacket p (senf::GREPacket::create());
 
-    BOOST_CHECK_EQUAL(   p->sync_byte(),                TRANSPORT_PACKET_SYNC_BYTE );
-    BOOST_CHECK(       ! p->transport_error_indicator()                            );
-    BOOST_CHECK(         p->pusi()                                                 );
-    BOOST_CHECK(       ! p->transport_priority()                                   );
-    BOOST_CHECK_EQUAL(   p->pid(),                      0x010fu                    );  
-    BOOST_CHECK_EQUAL(   p->transport_scrmbl_ctrl(),    0x0u                       );             
-    BOOST_CHECK_EQUAL(   p->adaptation_field_ctrl(),    0x1u                       );
-    BOOST_CHECK_EQUAL(   p->continuity_counter(),       0x0eu                      );  
+    BOOST_CHECK_EQUAL( senf::GREPacketParser::init_bytes+0u, 4u );
+    //BOOST_CHECK_EQUAL( p->bytes(), 4u );
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////