repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / tests / kits / media / FormatDescriptions.cpp
blob36538e9d58456253a95b634084f596f472197de9
1 /*
2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
4 */
7 #include "FormatDescriptions.h"
9 #include <MediaFormats.h>
11 #include <cppunit/TestCaller.h>
12 #include <cppunit/TestSuite.h>
15 FormatDescriptionsTest::FormatDescriptionsTest()
20 FormatDescriptionsTest::~FormatDescriptionsTest()
25 void
26 FormatDescriptionsTest::TestCompare()
28 media_format_description a;
29 a.family = B_AVI_FORMAT_FAMILY;
30 a.u.avi.codec = 'DIVX';
32 media_format_description b;
33 CPPUNIT_ASSERT(!(a == b));
35 b.family = a.family;
36 CPPUNIT_ASSERT(!(a == b));
38 a.family = B_QUICKTIME_FORMAT_FAMILY;
39 a.u.quicktime.vendor = 5;
40 a.u.quicktime.codec = 5;
42 b.family = B_QUICKTIME_FORMAT_FAMILY;
43 b.u.quicktime.vendor = 6;
44 b.u.quicktime.codec = 5;
45 CPPUNIT_ASSERT(a < b);
47 b.u.quicktime.vendor = 4;
48 CPPUNIT_ASSERT(b < a);
50 b.u.quicktime.vendor = 5;
51 b.u.quicktime.codec = 6;
52 CPPUNIT_ASSERT(a < b);
54 b.u.quicktime.codec = 4;
55 CPPUNIT_ASSERT(b < a);
57 a.family = B_MISC_FORMAT_FAMILY;
58 a.u.misc.file_format = 5;
59 a.u.misc.codec = 5;
61 b.family = B_MISC_FORMAT_FAMILY;
62 b.u.misc.file_format = 6;
63 b.u.misc.codec = 5;
64 CPPUNIT_ASSERT(a < b);
66 b.u.misc.file_format = 4;
67 CPPUNIT_ASSERT(b < a);
70 b.u.misc.file_format = 5;
71 b.u.misc.codec = 6;
72 CPPUNIT_ASSERT(a < b);
74 b.u.misc.codec = 4;
75 CPPUNIT_ASSERT(b < a);
79 /*static*/ void
80 FormatDescriptionsTest::AddTests(BTestSuite& parent)
82 CppUnit::TestSuite& suite = *new CppUnit::TestSuite("FormatDescriptionsTest");
84 suite.addTest(new CppUnit::TestCaller<FormatDescriptionsTest>(
85 "FormatDescriptionsTest::TestCompare",
86 &FormatDescriptionsTest::TestCompare));
88 parent.addTest("FormatDescriptionsTest", &suite);