1 /* 2 * Copyright 2014 Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "SizeofTest.h" 8 9 #include <MediaKit.h> 10 11 #include <cppunit/TestCaller.h> 12 #include <cppunit/TestSuite.h> 13 14 15 SizeofTest::SizeofTest() 16 { 17 } 18 19 20 SizeofTest::~SizeofTest() 21 { 22 } 23 24 25 void 26 SizeofTest::TestSize() 27 { 28 CPPUNIT_ASSERT_EQUAL(264, sizeof(BBuffer)); 29 CPPUNIT_ASSERT_EQUAL(240, sizeof(BBufferConsumer)); 30 CPPUNIT_ASSERT_EQUAL(56, sizeof(BBufferGroup)); 31 CPPUNIT_ASSERT_EQUAL(244, sizeof(BBufferProducer)); 32 CPPUNIT_ASSERT_EQUAL(140, sizeof(BContinuousParameter)); 33 CPPUNIT_ASSERT_EQUAL(240, sizeof(BControllable)); 34 CPPUNIT_ASSERT_EQUAL(124, sizeof(BDiscreteParameter)); 35 CPPUNIT_ASSERT_EQUAL(236, sizeof(BFileInterface)); 36 CPPUNIT_ASSERT_EQUAL(40, sizeof(BMediaAddOn)); 37 CPPUNIT_ASSERT_EQUAL(340, sizeof(BMediaEventLooper)); 38 CPPUNIT_ASSERT_EQUAL(560, sizeof(BMediaFile)); 39 CPPUNIT_ASSERT_EQUAL(72, sizeof(BMediaFiles)); 40 CPPUNIT_ASSERT_EQUAL(128, sizeof(BMediaFormats)); 41 CPPUNIT_ASSERT_EQUAL(164, sizeof(BMediaNode)); 42 CPPUNIT_ASSERT_EQUAL(440, sizeof(BMediaRoster)); 43 CPPUNIT_ASSERT_EQUAL(68, sizeof(BMediaTheme)); 44 CPPUNIT_ASSERT_EQUAL(760, sizeof(BMediaTrack)); 45 CPPUNIT_ASSERT_EQUAL(116, sizeof(BNullParameter)); 46 CPPUNIT_ASSERT_EQUAL(84, sizeof(BParameter)); 47 CPPUNIT_ASSERT_EQUAL(52, sizeof(BParameterGroup)); 48 CPPUNIT_ASSERT_EQUAL(124, sizeof(BSound)); 49 CPPUNIT_ASSERT_EQUAL(164, sizeof(BTimeCode)); 50 CPPUNIT_ASSERT_EQUAL(72, sizeof(BParameterWeb)); 51 CPPUNIT_ASSERT_EQUAL(264, sizeof(BSmallBuffer)); 52 CPPUNIT_ASSERT_EQUAL(808, sizeof(BSoundPlayer)); 53 CPPUNIT_ASSERT_EQUAL(32, sizeof(BTimedEventQueue)); 54 CPPUNIT_ASSERT_EQUAL(236, sizeof(BTimeSource)); 55 CPPUNIT_ASSERT_EQUAL(24, sizeof(media_node)); 56 CPPUNIT_ASSERT_EQUAL(328, sizeof(media_input)); 57 CPPUNIT_ASSERT_EQUAL(328, sizeof(media_output)); 58 CPPUNIT_ASSERT_EQUAL(256, sizeof(live_node_info)); 59 CPPUNIT_ASSERT_EQUAL(372, sizeof(media_request_info)); 60 CPPUNIT_ASSERT_EQUAL(16, sizeof(media_destination)); 61 CPPUNIT_ASSERT_EQUAL(16, sizeof(media_source)); 62 CPPUNIT_ASSERT_EQUAL(200, sizeof(dormant_node_info)); 63 CPPUNIT_ASSERT_EQUAL(116, sizeof(flavor_info)); 64 CPPUNIT_ASSERT_EQUAL(320, sizeof(dormant_flavor_info)); 65 CPPUNIT_ASSERT_EQUAL(192, sizeof(media_format)); 66 67 // printf("BMediaBufferDecoder sizeof = %ld\n",sizeof(BMediaBufferDecoder)); 68 // printf("MediaBufferEncoder sizeof = %ld\n",sizeof(MediaBufferEncoder)); 69 // printf("BMediaDecoder sizeof = %ld\n",sizeof(BMediaDecoder)); 70 // printf("BMediaEncoder sizeof = %ld\n",sizeof(BMediaEncoder)); 71 } 72 73 74 /*static*/ void 75 SizeofTest::AddTests(BTestSuite& parent) 76 { 77 CppUnit::TestSuite& suite = *new CppUnit::TestSuite("AreaTest"); 78 79 suite.addTest(new CppUnit::TestCaller<SizeofTest>( 80 "SizeofTest::TestSize", &SizeofTest::TestSize)); 81 82 parent.addTest("SizeofTest", &suite); 83 } 84