xref: /haiku/src/tests/kits/storage/MimeTypeTest.h (revision a30a4a41f948ebb03b95dab065a27a584ac0c97a)
1 // MimeTypeTest.h
2 
3 #ifndef __sk_mime_type_test_h__
4 #define __sk_mime_type_test_h__
5 
6 #include <cppunit/TestCaller.h>
7 #include <cppunit/TestSuite.h>
8 
9 #include "BasicTest.h"
10 #include <Mime.h>
11 
12 class BTestApp;
13 
14 // Function pointer types for test sharing between {Get,Set}{Short,Long}Description()
15 typedef status_t (BMimeType::*GetDescriptionFunc)(char* description) const;
16 typedef status_t (BMimeType::*SetDescriptionFunc)(const char* description);
17 typedef status_t (BMimeType::*DeleteDescriptionFunc)();
18 
19 class IconHelper;
20 class IconForTypeHelper;
21 class NotificationMessage;
22 
23 class MimeTypeTest : public BasicTest {
24 public:
25 	static CppUnit::Test* Suite();
26 
27 	// This function called before *each* test added in Suite()
28 	void setUp();
29 
30 	// This function called after *each* test added in Suite()
31 	void tearDown();
32 
33 	//------------------------------------------------------------
34 	// Test functions
35 	//------------------------------------------------------------
36 	void InstallDeleteTest();
37 	void AppHintTest();
38 	void AttrInfoTest();
39 	void FileExtensionsTest();
40 	void LargeIconTest();
41 	void MiniIconTest();
42 	void LargeIconForTypeTest();
43 	void MiniIconForTypeTest();
44 	void InstalledTypesTest();
45 	void LongDescriptionTest();
46 	void ShortDescriptionTest();
47 	void PreferredAppTest();
48 	void SupportingAppsTest();
49 	void SupportedTypesTest();
50 	void WildcardAppsTest();
51 
52 	void InitTest();
53 	void StringTest();
54 	void MonitoringTest();
55 	void UpdateMimeInfoTest();
56 	void CreateAppMetaMimeTest();
57 	void GetDeviceIconTest();
58 	void SnifferRuleTest();
59 	void SniffingTest();
60 
61 	//------------------------------------------------------------
62 	// Helper functions
63 	//------------------------------------------------------------
64 	void DescriptionTest(GetDescriptionFunc getDescr, SetDescriptionFunc setDescr,
65 	                       DeleteDescriptionFunc deleteDescr);
66 	void IconTest(IconHelper &helper);
67 	void IconForTypeTest(IconForTypeHelper &helper);
68 
69 	void CheckNotificationMessages(const NotificationMessage *messages,
70 								   int32 count);
71 	void VerifyInstalledTypes();
72 
73 private:
74 	BTestApp	*fApplication;
75 };
76 
77 
78 #endif	// __sk_mime_type_test_h__
79