Lines Matching refs:mime

23 	#include <mime/database_support.h>
55 "x-vnd.obos.mime.test.test1";
57 "x-vnd.obos.mime.test.test2";
59 "x-vnd.obos.mime.test.test3";
94 static const char *testSig = "application/x-vnd.obos.mime-type-test";
95 static const char *testSig2 = "application/x-vnd.obos.mime-type-test-2";
96 static const char *longSig = "application/x-vnd.obos.mime-type-test-long."
453 virtual status_t GetIcon(BMimeType &mime, BBitmap *icon) {
454 return mime.GetIcon(icon, size);
458 virtual status_t SetIcon(BMimeType &mime, BBitmap *icon) {
459 return mime.SetIcon(icon, size);
463 virtual status_t DeleteIcon(BMimeType &mime) {
467 return mime.DeleteIcon(size);
499 virtual status_t GetIcon(BMimeType &mime, BBitmap *icon) {
500 return mime.GetIconForType(fileType.c_str(), icon, size);
502 virtual status_t SetIcon(BMimeType &mime, BBitmap *icon) {
503 return mime.SetIconForType(fileType.c_str(), icon, size);
505 virtual status_t DeleteIcon(BMimeType &mime) {
509 return mime.DeleteIconForType(fileType.c_str(), size);
553 // local mime database which we'll use for certain Haiku tests
575 /* BMimeType mime(testType);
576 status_t err = mime.InitCheck();
577 if (!err && mime.IsInstalled())
578 err = mime.Delete();
632 BMimeType mime;
634 CHK(mime.InitCheck() == B_NO_INIT);
635 CHK(mime.GetAppHint(&ref) != B_OK); // R5 == B_BAD_VALUE
636 CHK(mime.SetAppHint(&ref) != B_OK); // R5 == B_BAD_VALUE
642 BMimeType mime(testType);
643 CHK(mime.InitCheck() == B_OK);
645 if (mime.IsInstalled())
646 CHK(mime.Delete() == B_OK);
648 CHK(!mime.IsInstalled());
649 CHK(mime.GetAppHint(NULL) != B_OK); // R5 == B_BAD_VALUE
650 CHK(!mime.IsInstalled());
651 CHK(mime.SetAppHint(NULL) != B_OK); // Installs, R5 == B_ENTRY_NOT_FOUND
652 CHK(mime.IsInstalled());
653 CHK(mime.GetAppHint(NULL) != B_OK); // R5 == B_BAD_VALUE
654 CHK(mime.SetAppHint(NULL) != B_OK); // R5 == B_ENTRY_NOT_FOUND
656 CHK(!mime.IsInstalled());
657 CHK(mime.GetAppHint(NULL) != B_OK); // B_BAD_VALUE
658 CHK(!mime.IsInstalled());
659 CHK(mime.SetAppHint(NULL) != B_OK); // B_ENTRY_NOT_FOUND
660 CHK(!mime.IsInstalled());
661 CHK(mime.SetAppHint(&appRef) == B_OK);
662 CHK(mime.IsInstalled());
663 CHK(mime.GetAppHint(&ref) == B_OK);
665 CHK(mime.SetAppHint(NULL) == B_OK);
666 CHK(mime.IsInstalled());
667 CHK(mime.GetAppHint(&ref) != B_OK); // B_ENTRY_NOT_FOUND
675 BMimeType mime(testType);
676 CHK(mime.InitCheck() == B_OK);
678 if (mime.IsInstalled())
679 CHK(mime.Delete() == B_OK);
680 CHK(!mime.IsInstalled());
681 CHK(mime.DeleteAppHint() != B_OK);
682 CHK(!mime.IsInstalled());
683 CHK(mime.SetAppHint(&appRef) == B_OK);
684 CHK(mime.IsInstalled());
685 CHK(mime.GetAppHint(&ref) == B_OK);
687 CHK(mime.DeleteAppHint() == B_OK);
688 CHK(mime.IsInstalled());
689 CHK(mime.GetAppHint(&ref) != B_OK);
696 BMimeType mime(testType);
697 CHK(mime.InitCheck() == B_OK);
699 if (mime.IsInstalled())
700 CHK(mime.Delete() == B_OK);
701 CHK(!mime.IsInstalled());
702 CHK(mime.GetAppHint(&ref) != B_OK); // R5 == B_ENTRY_NOT_FOUND
703 CHK(!mime.IsInstalled());
704 CHK(mime.SetAppHint(&appRef) == B_OK);
705 CHK(mime.IsInstalled());
706 CHK(mime.GetAppHint(&ref) == B_OK);
713 BMimeType mime(testType);
714 CHK(mime.InitCheck() == B_OK);
716 if (mime.IsInstalled())
717 CHK(mime.Delete() == B_OK);
718 if (!mime.IsInstalled())
719 CHK(mime.Install() == B_OK);
720 CHK(mime.IsInstalled());
722 CHK(mime.GetAppHint(&ref) == B_ENTRY_NOT_FOUND);
724 CHK(mime.SetAppHint(&appRef) == B_OK);
725 CHK(mime.GetAppHint(&ref) == B_OK);
728 CHK(mime.SetAppHint(&appRef2) == B_OK);
729 CHK(mime.GetAppHint(&ref) == B_OK);
737 BMimeType mime(testType);
738 CHK(mime.InitCheck() == B_OK);
740 if (mime.IsInstalled())
741 CHK(mime.Delete() == B_OK);
742 if (!mime.IsInstalled())
743 CHK(mime.Install() == B_OK);
744 CHK(mime.IsInstalled());
745 CHK(mime.SetAppHint(&appRef) == B_OK);
746 CHK(mime.SetAppHint(&ref) != B_OK); // R5 == B_BAD_VALUE
752 BMimeType mime(testType);
753 CHK(mime.InitCheck() == B_OK);
755 if (mime.IsInstalled())
756 CHK(mime.Delete() == B_OK);
757 if (!mime.IsInstalled())
758 CHK(mime.Install() == B_OK);
759 CHK(mime.IsInstalled());
760 CHK(mime.SetAppHint(&appRef) == B_OK);
761 CHK(mime.SetAppHint(&ref) != B_OK); // R5 == B_ENTRY_NOT_FOUND
772 BMimeType mime(testType);
773 CHK(mime.InitCheck() == B_OK);
775 if (mime.IsInstalled())
776 CHK(mime.Delete() == B_OK);
777 if (!mime.IsInstalled())
778 CHK(mime.Install() == B_OK);
779 CHK(mime.IsInstalled());
780 CHK(mime.SetAppHint(&appRef) == B_OK);
781 CHK(mime.SetAppHint(&fakeRef) == B_OK);
782 CHK(mime.GetAppHint(&ref) == B_OK);
848 BMimeType mime;
851 CHK(mime.InitCheck() == B_NO_INIT);
852 CHK(mime.GetAttrInfo(&msg) != B_OK); // R5 == B_BAD_VALUE
853 CHK(mime.SetAttrInfo(&msg) != B_OK); // R5 == B_BAD_VALUE
861 BMimeType mime(testType);
862 CHK(mime.InitCheck() == B_OK);
864 if (mime.IsInstalled())
865 CHK(mime.Delete() == B_OK);
866 CHK(!mime.IsInstalled());
867 CHK(mime.DeleteAttrInfo() != B_OK);
868 CHK(!mime.IsInstalled());
870 CHK(mime.SetAttrInfo(&msg1) == B_OK);
871 CHK(mime.IsInstalled());
873 CHK(mime.GetAttrInfo(&msg) == B_OK);
876 CHK(mime.SetAttrInfo(NULL) == B_OK);
877 CHK(mime.IsInstalled());
878 CHK(mime.GetAttrInfo(&msg) != B_OK);
886 BMimeType mime(testType);
887 CHK(mime.InitCheck() == B_OK);
889 if (mime.IsInstalled())
890 CHK(mime.Delete() == B_OK);
891 CHK(!mime.IsInstalled());
892 CHK(mime.DeleteAttrInfo() != B_OK);
893 CHK(!mime.IsInstalled());
895 CHK(mime.SetAttrInfo(&msg1) == B_OK);
896 CHK(mime.IsInstalled());
898 CHK(mime.GetAttrInfo(&msg) == B_OK);
901 CHK(mime.DeleteAttrInfo() == B_OK);
902 CHK(mime.IsInstalled());
903 CHK(mime.GetAttrInfo(&msg) != B_OK);
911 BMimeType mime(testType);
912 CHK(mime.InitCheck() == B_OK);
915 if (mime.IsInstalled())
916 CHK(mime.Delete() == B_OK);
917 if (!mime.IsInstalled())
918 CHK(mime.Install() == B_OK);
919 CHK(mime.IsInstalled());
926 CHK(mime.SetAttrInfo(&msgIncomplete1) == B_OK);
927 CHK(mime.GetAttrInfo(&msg) == B_OK);
938 BMimeType mime(testType);
939 CHK(mime.InitCheck() == B_OK);
942 if (mime.IsInstalled())
943 CHK(mime.Delete() == B_OK);
944 if (!mime.IsInstalled())
945 CHK(mime.Install() == B_OK);
946 CHK(mime.IsInstalled());
953 CHK(mime.SetAttrInfo(&msgIncomplete1) == B_OK);
954 CHK(mime.GetAttrInfo(&msg) == B_OK);
964 BMimeType mime(testType);
970 if (mime.IsInstalled())
971 CHK(mime.Delete() == B_OK);
972 if (!mime.IsInstalled())
973 CHK(mime.Install() == B_OK);
974 CHK(mime.IsInstalled());
978 CHK(mime.SetAttrInfo(&msgEmpty) == B_OK);
979 CHK(mime.GetAttrInfo(&msg) == B_OK);
987 BMimeType mime(testType);
997 if (mime.IsInstalled())
998 CHK(mime.Delete() == B_OK);
999 if (!mime.IsInstalled())
1000 CHK(mime.Install() == B_OK);
1001 CHK(mime.IsInstalled());
1008 CHK(mime.SetAttrInfo(&msgExtraSet) == B_OK);
1009 CHK(mime.GetAttrInfo(&msg) == B_OK);
1017 CHK(mime.GetAttrInfo(&msgExtraGet) == B_OK);
1025 CHK(mime.GetAttrInfo(&msgExtraGet) == B_OK); // Reinitializes result (clearing extra fields)
1033 BMimeType mime(testType);
1037 CHK(mime.InitCheck() == B_OK);
1039 if (mime.IsInstalled())
1040 CHK(mime.Delete() == B_OK);
1042 CHK(!mime.IsInstalled());
1043 CHK(mime.GetAttrInfo(&msg) != B_OK); // R5 == B_ENTRY_NOT_FOUND
1044 CHK(!mime.IsInstalled());
1045 CHK(mime.SetAttrInfo(&msg) == B_OK);
1046 CHK(mime.IsInstalled());
1047 CHK(mime.GetAttrInfo(&msg2) == B_OK);
1056 BMimeType mime(testType);
1057 CHK(mime.InitCheck() == B_OK);
1060 if (mime.IsInstalled())
1061 CHK(mime.Delete() == B_OK);
1062 if (!mime.IsInstalled())
1063 CHK(mime.Install() == B_OK);
1064 CHK(mime.IsInstalled());
1071 CHK(mime.SetAttrInfo(&msg1) == B_OK);
1072 CHK(mime.GetAttrInfo(&msg) == B_OK);
1085 CHK(mime.SetAttrInfo(&msg2) == B_OK);
1086 CHK(mime.GetAttrInfo(&msg) == B_OK);
1100 CHK(mime.SetAttrInfo(NULL) == B_OK); // R5 == CRASH! despite what one might think should happen
1101 CHK(mime.GetAttrInfo(&msg) != B_OK);
1140 BMimeType mime;
1142 CHK(mime.InitCheck() == B_NO_INIT);
1143 CHK(mime.GetFileExtensions(&msg) != B_OK); // R5 == B_BAD_VALUE
1144 CHK(mime.SetFileExtensions(&msg) != B_OK); // R5 == B_BAD_VALUE
1151 BMimeType mime(testType);
1152 CHK(mime.InitCheck() == B_OK);
1154 if (mime.IsInstalled())
1155 CHK(mime.Delete() == B_OK);
1156 CHK(!mime.IsInstalled());
1157 CHK(mime.DeleteFileExtensions() != B_OK);
1158 CHK(!mime.IsInstalled());
1160 CHK(mime.SetFileExtensions(&msg1) == B_OK);
1161 CHK(mime.IsInstalled());
1163 CHK(mime.GetFileExtensions(&msg) == B_OK);
1166 CHK(mime.SetFileExtensions(NULL) == B_OK);
1167 CHK(mime.IsInstalled());
1168 CHK(mime.GetFileExtensions(&msg) != B_OK);
1176 BMimeType mime(testType);
1177 CHK(mime.InitCheck() == B_OK);
1179 if (mime.IsInstalled())
1180 CHK(mime.Delete() == B_OK);
1181 CHK(!mime.IsInstalled());
1182 CHK(mime.DeleteFileExtensions() != B_OK);
1183 CHK(!mime.IsInstalled());
1185 CHK(mime.SetFileExtensions(&msg1) == B_OK);
1186 CHK(mime.IsInstalled());
1188 CHK(mime.GetFileExtensions(&msg) == B_OK);
1191 CHK(mime.DeleteFileExtensions() == B_OK);
1192 CHK(mime.IsInstalled());
1193 CHK(mime.GetFileExtensions(&msg) != B_OK);
1199 BMimeType mime(testType);
1205 if (mime.IsInstalled())
1206 CHK(mime.Delete() == B_OK);
1207 if (!mime.IsInstalled())
1208 CHK(mime.Install() == B_OK);
1209 CHK(mime.IsInstalled());
1213 CHK(mime.SetFileExtensions(&msgEmpty) == B_OK);
1214 CHK(mime.GetFileExtensions(&msg) == B_OK);
1221 BMimeType mime(testType);
1231 if (mime.IsInstalled())
1232 CHK(mime.Delete() == B_OK);
1233 if (!mime.IsInstalled())
1234 CHK(mime.Install() == B_OK);
1235 CHK(mime.IsInstalled());
1242 CHK(mime.SetFileExtensions(&msgExtraSet) == B_OK);
1243 CHK(mime.GetFileExtensions(&msg) == B_OK);
1251 CHK(mime.GetFileExtensions(&msgExtraGet) == B_OK);
1259 CHK(mime.GetFileExtensions(&msgExtraGet) == B_OK); // Reinitializes result (clearing extra fields)
1268 BMimeType mime(testType);
1271 if (mime.IsInstalled())
1272 CHK(mime.Delete() == B_OK);
1273 if (!mime.IsInstalled())
1274 CHK(mime.Install() == B_OK);
1275 CHK(mime.IsInstalled());
1282 CHK(mime.SetFileExtensions(&msg1) == B_OK);
1283 CHK(mime.GetFileExtensions(&msg) == B_OK);
1296 CHK(mime.SetFileExtensions(&msg2) == B_OK);
1297 CHK(mime.GetFileExtensions(&msg) == B_OK);
1311 CHK(mime.SetFileExtensions(NULL) == B_OK); // R5 == CRASH! despite what the BeBook says
1312 CHK(mime.GetFileExtensions(&msg) != B_OK);
1330 BMimeType mime;
1331 CHK(mime.InitCheck() == B_NO_INIT);
1332 CHK(helper.GetIcon(mime, bmp) != B_OK); // R5 == B_BAD_VALUE
1333 CHK(helper.SetIcon(mime, bmp) != B_OK); // R5 == B_BAD_VALUE
1338 BMimeType mime(testType);
1339 CHK(mime.InitCheck() == B_OK);
1341 if (mime.IsInstalled())
1342 CHK(mime.Delete() == B_OK);
1343 CHK(!mime.IsInstalled());
1345 CHK(helper.GetIcon(mime, bmp) != B_OK); // R5 == B_ENTRY_NOT_FOUND
1346 CHK(!mime.IsInstalled());
1347 CHK(helper.SetIcon(mime, helper.Bitmap1()) == B_OK);
1348 CHK(mime.IsInstalled());
1349 CHK(helper.GetIcon(mime, bmp) == B_OK);
1355 BMimeType mime(testType);
1356 CHK(mime.InitCheck() == B_OK);
1358 if (mime.IsInstalled())
1359 CHK(mime.Delete() == B_OK);
1360 CHK(!mime.IsInstalled());
1362 CHK(helper.GetIcon(mime, NULL) != B_OK); // B_BAD_VALUE
1363 CHK(!mime.IsInstalled());
1364 CHK(helper.SetIcon(mime, NULL) != B_OK); // R5 == Installs, B_ENTRY_NOT_FOUND
1367 CHK(mime.IsInstalled());
1369 CHK(!mime.IsInstalled());
1370 CHK(mime.Install() == B_OK);
1372 CHK(helper.GetIcon(mime, bmp) != B_OK); // B_ENTRY_NOT_FOUND
1374 CHK(helper.GetIcon(mime, NULL) != B_OK); // B_BAD_VALUE
1375 CHK(helper.SetIcon(mime, helper.Bitmap1()) == B_OK);
1376 CHK(helper.GetIcon(mime, bmp) == B_OK);
1378 CHK(helper.SetIcon(mime, NULL) == B_OK);
1379 CHK(helper.GetIcon(mime, bmp) != B_OK); // B_ENTRY_NOT_FOUND
1385 BMimeType mime(testType);
1386 CHK(mime.InitCheck() == B_OK);
1388 if (mime.IsInstalled())
1389 CHK(mime.Delete() == B_OK);
1390 CHK(!mime.IsInstalled());
1391 CHK(helper.DeleteIcon(mime) != B_OK);
1392 CHK(!mime.IsInstalled());
1393 CHK(helper.SetIcon(mime, helper.Bitmap2()) == B_OK);
1394 CHK(mime.IsInstalled());
1397 CHK(helper.GetIcon(mime, bmp) == B_OK);
1399 CHK(helper.DeleteIcon(mime) == B_OK);
1400 CHK(mime.IsInstalled());
1401 CHK(helper.GetIcon(mime, bmp) != B_OK);
1407 BMimeType mime(testType);
1408 CHK(mime.InitCheck() == B_OK);
1410 if (mime.IsInstalled())
1411 CHK(mime.Delete() == B_OK);
1412 if (!mime.IsInstalled())
1413 CHK(mime.Install() == B_OK);
1414 CHK(mime.IsInstalled());
1420 CHK(helper.SetIcon(mime, helper.Bitmap1()) == B_OK);
1421 CHK(helper.GetIcon(mime, bmp) == B_OK);
1423 CHK(helper.SetIcon(mime, &testBmp) != B_OK); // R5 == B_BAD_VALUE
1424 CHK(helper.GetIcon(mime, bmp) == B_OK);
1429 CHK(helper.SetIcon(mime, helper.Bitmap1()) == B_OK);
1430 CHK(helper.GetIcon(mime, &testBmp) != B_OK); // R5 == B_BAD_VALUE
1435 BMimeType mime(testType);
1436 CHK(mime.InitCheck() == B_OK);
1438 if (mime.IsInstalled())
1439 CHK(mime.Delete() == B_OK);
1440 if (!mime.IsInstalled())
1441 CHK(mime.Install() == B_OK);
1442 CHK(mime.IsInstalled());
1448 CHK(helper.SetIcon(mime, helper.Bitmap1()) == B_OK);
1449 CHK(helper.GetIcon(mime, bmp) == B_OK);
1451 CHK(helper.SetIcon(mime, &testBmp) != B_OK); // R5 == B_BAD_VALUE
1452 CHK(helper.GetIcon(mime, bmp) == B_OK);
1457 CHK(helper.SetIcon(mime, helper.Bitmap1()) == B_OK);
1458 CHK(helper.GetIcon(mime, &testBmp) != B_OK); // R5 == B_BAD_VALUE
1464 BMimeType mime(testType);
1465 CHK(mime.InitCheck() == B_OK);
1467 if (mime.IsInstalled())
1468 CHK(mime.Delete() == B_OK);
1469 if (!mime.IsInstalled())
1470 CHK(mime.Install() == B_OK);
1471 CHK(mime.IsInstalled());
1482 CHK(helper.SetIcon(mime, helper.Bitmap1()) == B_OK);
1483 CHK(helper.GetIcon(mime, bmp) == B_OK);
1485 CHK(helper.SetIcon(mime, &testBmp) == B_OK);
1488 CHK(helper.GetIcon(mime, bmp) == B_OK); // R5 == CRASH!, Haiku == Damn right I can handle that shit
1497 BMimeType mime(testType);
1498 CHK(mime.InitCheck() == B_OK);
1500 if (mime.IsInstalled())
1501 CHK(mime.Delete() == B_OK);
1502 if (!mime.IsInstalled())
1503 CHK(mime.Install() == B_OK);
1504 CHK(mime.IsInstalled());
1508 CHK(helper.SetIcon(mime, helper.Bitmap1()) == B_OK);
1509 CHK(helper.GetIcon(mime, bmp) == B_OK);
1513 CHK(helper.SetIcon(mime, helper.Bitmap2()) == B_OK);
1514 CHK(helper.GetIcon(mime, bmp) == B_OK);
1532 BMimeType mime(testType);
1533 CHK(mime.InitCheck() == B_OK);
1535 if (mime.IsInstalled())
1536 CHK(mime.Delete() == B_OK);
1537 if (!mime.IsInstalled())
1538 CHK(mime.Install() == B_OK);
1539 CHK(mime.IsInstalled());
1543 CHK(mime.SetIconForType(testTypeInvalid, helper.Bitmap1(), helper.Size()) != B_OK); // R5 == B_BAD_VALUE
1544 CHK(mime.GetIconForType(testTypeInvalid, bmp, helper.Size()) != B_OK); // R5 == B_BAD_VALUE
1550 BMimeType mime(testType);
1551 CHK(mime.InitCheck() == B_OK);
1553 if (mime.IsInstalled())
1554 CHK(mime.Delete() == B_OK);
1555 if (!mime.IsInstalled())
1556 CHK(mime.Install() == B_OK);
1557 CHK(mime.IsInstalled());
1561 CHK(mime.SetIconForType(NULL, helper.Bitmap1(), helper.Size()) == B_OK);
1562 CHK(mime.GetIconForType(NULL, bmp, helper.Size()) == B_OK);
1567 CHK(mime.GetIcon(bmp, helper.Size()) == B_OK);
1570 CHK(mime.SetIconForType(NULL, NULL, helper.Size()) == B_OK);
1571 CHK(mime.GetIconForType(NULL, bmp, helper.Size()) != B_OK); // B_ENTRY_NOT_FOUND
1572 CHK(mime.GetIcon(bmp, helper.Size()) != B_OK); // B_ENTRY_NOT_FOUND
1679 // Verify it's a valid mime string. If so, find and remove from our set
1769 // Verify it's a valid mime string. If so, find and remove from our set
1830 BMimeType mime(testTypeApp1);
1831 CHK(mime.InitCheck() == B_OK);
1832 if (mime.IsInstalled()) {
1833 CHK(mime.Delete() == B_OK);
1835 CHK(mime.Install() == B_OK);
1838 CHK(mime.Install() == B_OK);
1840 CHK(mime.Delete() == B_OK);
1887 BMimeType mime;
1888 CPPUNIT_ASSERT(mime.InitCheck() == B_NO_INIT);
1889 CPPUNIT_ASSERT((mime.*getDescr)(str) != B_OK); // R5 == B_BAD_VALUE
1890 CPPUNIT_ASSERT((mime.*setDescr)(str) != B_OK); // R5 == B_BAD_VALUE
1896 BMimeType mime(testType);
1897 CHK(mime.InitCheck() == B_OK);
1899 if (mime.IsInstalled())
1900 CHK(mime.Delete() == B_OK);
1901 CHK(!mime.IsInstalled());
1902 CHK((mime.*getDescr)(str) != B_OK); // R5 == B_ENTRY_NOT_FOUND
1903 CHK(!mime.IsInstalled());
1904 CHK((mime.*setDescr)(testDescr) == B_OK); // R5 == Installs (but doesn't set), B_OK
1905 CHK(mime.IsInstalled());
1906 CHK((mime.*getDescr)(str) == B_OK);
1915 BMimeType mime(testType);
1916 CHK(mime.InitCheck() == B_OK);
1918 if (mime.IsInstalled())
1919 CHK(mime.Delete() == B_OK);
1920 CHK(!mime.IsInstalled());
1921 CHK((mime.*getDescr)(NULL) == B_BAD_VALUE);
1922 CHK(!mime.IsInstalled());
1923 CHK((mime.*setDescr)(NULL) == B_ENTRY_NOT_FOUND); // Trying to delete non-existent attribute
1924 CHK(!mime.IsInstalled());
1925 CHK((mime.*setDescr)(testDescr) == B_OK);
1926 CHK(mime.IsInstalled());
1928 CHK((mime.*getDescr)(str) == B_OK);
1930 CHK((mime.*setDescr)(NULL) == B_OK); // Delete the attribute
1931 CHK(mime.IsInstalled());
1932 CHK((mime.*getDescr)(str) == B_ENTRY_NOT_FOUND);
1940 BMimeType mime(testType);
1941 CHK(mime.InitCheck() == B_OK);
1943 if (mime.IsInstalled())
1944 CHK(mime.Delete() == B_OK);
1945 CHK(!mime.IsInstalled());
1946 CHK((mime.*deleteDescr)() != B_OK);
1947 CHK(!mime.IsInstalled());
1948 CHK((mime.*setDescr)(testDescr) == B_OK);
1949 CHK(mime.IsInstalled());
1951 CHK((mime.*getDescr)(str) == B_OK);
1953 CHK((mime.*deleteDescr)() == B_OK);
1954 CHK(mime.IsInstalled());
1955 CHK((mime.*getDescr)(str) != B_OK);
1962 BMimeType mime(testType);
1963 CHK(mime.InitCheck() == B_OK);
1965 if (mime.IsInstalled())
1966 CHK(mime.Delete() == B_OK);
1967 if (!mime.IsInstalled())
1968 CHK(mime.Install() == B_OK);
1970 CHK(mime.IsInstalled());
1971 CHK((mime.*getDescr)(str) == B_ENTRY_NOT_FOUND); // R5 == B_ENTRY_NOT_FOUND
1973 CHK((mime.*setDescr)(testDescr) == B_OK);
1974 CHK((mime.*getDescr)(str) == B_OK);
1977 CHK((mime.*setDescr)(testDescr2) == B_OK);
1978 CHK((mime.*getDescr)(str) == B_OK);
1986 BMimeType mime(testType);
1987 CHK(mime.InitCheck() == B_OK);
1989 if (mime.IsInstalled())
1990 CHK(mime.Delete() == B_OK);
1991 if (!mime.IsInstalled())
1992 CHK(mime.Install() == B_OK);
1994 CHK((mime.*setDescr)(longDescr) != B_OK); // R5 == B_BAD_VALUE
1995 CHK((mime.*getDescr)(str) == B_ENTRY_NOT_FOUND);
1997 CHK((mime.*setDescr)(testDescr) == B_OK);
1998 CHK((mime.*setDescr)(longDescr) != B_OK); // R5 == B_BAD_VALUE
1999 CHK((mime.*getDescr)(str) == B_OK);
2016 BMimeType mime;
2017 CPPUNIT_ASSERT(mime.InitCheck() == B_NO_INIT);
2018 CPPUNIT_ASSERT(mime.GetPreferredApp(str) != B_OK); // R5 == B_BAD_VALUE
2019 CPPUNIT_ASSERT(mime.SetPreferredApp(str) != B_OK); // R5 == B_BAD_VALUE
2024 BMimeType mime(testType);
2025 CHK(mime.InitCheck() == B_OK);
2027 if (mime.IsInstalled())
2028 CHK(mime.Delete() == B_OK);
2029 CHK(!mime.IsInstalled());
2030 CHK(mime.GetPreferredApp(str) != B_OK); // R5 == B_ENTRY_NOT_FOUND
2031 CHK(!mime.IsInstalled());
2032 CHK(mime.SetPreferredApp(testSig) == B_OK); // R5 == Installs (but doesn't set), B_OK
2033 CHK(mime.IsInstalled());
2034 CHK(mime.GetPreferredApp(str) == B_OK);
2040 BMimeType mime(testType);
2041 CHK(mime.InitCheck() == B_OK);
2043 if (mime.IsInstalled())
2044 CHK(mime.Delete() == B_OK);
2046 CHK(!mime.IsInstalled());
2047 CHK(mime.GetPreferredApp(NULL) != B_OK); // R5 == B_ENTRY_NOT_FOUND
2048 CHK(!mime.IsInstalled());
2049 CHK(mime.SetPreferredApp(NULL) != B_OK); // R5 == Installs (but doesn't set), B_ENTRY_NOT_FOUND
2050 CHK(mime.IsInstalled());
2051 CHK(mime.GetPreferredApp(str) == B_ENTRY_NOT_FOUND);
2053 CHK(!mime.IsInstalled());
2054 CHK(mime.GetPreferredApp(NULL) != B_OK); // Haiku == B_BAD_VALUE
2055 CHK(!mime.IsInstalled());
2056 CHK(mime.SetPreferredApp(NULL) != B_OK); // Haiku == B_ENTRY_NOT_FOUND
2057 CHK(!mime.IsInstalled());
2058 CHK(mime.SetPreferredApp(testSig) == B_OK);
2059 CHK(mime.IsInstalled());
2061 CHK(mime.GetPreferredApp(str) == B_OK);
2063 CHK(mime.SetPreferredApp(NULL) == B_OK);
2064 CHK(mime.IsInstalled());
2066 CHK(mime.GetPreferredApp(str) != B_OK); // Haiku == B_ENTRY_NOT_FOUND
2072 BMimeType mime(testType);
2073 CHK(mime.InitCheck() == B_OK);
2075 if (mime.IsInstalled())
2076 CHK(mime.Delete() == B_OK);
2077 if (!mime.IsInstalled())
2078 CHK(mime.Install() == B_OK);
2079 CHK(mime.IsInstalled());
2080 CHK(mime.GetPreferredApp(NULL) != B_OK); // R5 == B_BAD_ADDRESS
2081 CHK(mime.SetPreferredApp(NULL) != B_OK); // R5 == B_ENTRY_NOT_FOUND
2082 CHK(mime.GetPreferredApp(NULL) != B_OK); // R5 == B_BAD_ADDRESS
2089 BMimeType mime(testType);
2090 CHK(mime.InitCheck() == B_OK);
2092 if (mime.IsInstalled())
2093 CHK(mime.Delete() == B_OK);
2094 CHK(!mime.IsInstalled());
2095 CHK(mime.DeletePreferredApp() != B_OK);
2096 CHK(!mime.IsInstalled());
2097 CHK(mime.SetPreferredApp(testSig) == B_OK);
2098 CHK(mime.IsInstalled());
2100 CHK(mime.GetPreferredApp(str) == B_OK);
2102 CHK(mime.DeletePreferredApp() == B_OK);
2103 CHK(mime.IsInstalled());
2104 CHK(mime.GetPreferredApp(str) != B_OK);
2110 BMimeType mime(testType);
2111 CHK(mime.InitCheck() == B_OK);
2113 if (mime.IsInstalled())
2114 CHK(mime.Delete() == B_OK);
2115 if (!mime.IsInstalled())
2116 CHK(mime.Install() == B_OK);
2118 CHK(mime.IsInstalled());
2119 CHK(mime.GetPreferredApp(str) == B_ENTRY_NOT_FOUND); // R5 == B_ENTRY_NOT_FOUND
2121 CHK(mime.SetPreferredApp(testSig) == B_OK);
2122 CHK(mime.GetPreferredApp(str) == B_OK);
2125 CHK(mime.SetPreferredApp(testSig2) == B_OK);
2126 CHK(mime.GetPreferredApp(str) == B_OK);
2133 BMimeType mime(testType);
2134 CHK(mime.InitCheck() == B_OK);
2136 if (mime.IsInstalled())
2137 CHK(mime.Delete() == B_OK);
2138 if (!mime.IsInstalled())
2139 CHK(mime.Install() == B_OK);
2141 CHK(mime.SetPreferredApp(longSig) != B_OK); // R5 == B_BAD_VALUE
2142 CHK(mime.GetPreferredApp(str) == B_ENTRY_NOT_FOUND);
2144 CHK(mime.SetPreferredApp(testSig) == B_OK);
2145 CHK(mime.SetPreferredApp(longSig) != B_OK); // R5 == B_BAD_VALUE
2146 CHK(mime.GetPreferredApp(str) == B_OK);
2211 BMimeType mime;
2212 CHK(mime.InitCheck() == B_NO_INIT);
2213 CHK(!mime.IsInstalled());
2214 CHK(mime.Install() != B_OK); // R5 == B_BAD_VALUE
2215 CHK(mime.Delete() != B_OK); // R5 == B_BAD_VALUE
2220 BMimeType mime(testTypeInvalid);
2221 CHK(mime.InitCheck() != B_OK); // R5 == B_BAD_VALUE
2222 CHK(!mime.IsInstalled());
2223 CHK(mime.Install() != B_OK); // R5 == B_BAD_VALUE
2224 CHK(mime.Delete() != B_OK); // R5 == B_BAD_VALUE
2230 BMimeType mime(testType);
2231 CHK(mime.InitCheck() == B_OK);
2232 CHK(!mime.IsInstalled());
2233 CHK(mime.Delete() != B_OK); // R5 == B_ENTRY_NOT_FOUND, Haiku == B_ENTRY_NOT_FOUND
2235 CHK(mime.Install() == B_OK);
2237 CHK(mime.IsInstalled());
2239 CHK(mime.Install() != B_OK); // We ought to return something standard and logical here, as R5 is random
2241 CHK(mime.Delete() == B_OK);
2243 CHK(!mime.IsInstalled());
2364 BMimeType mime;
2367 CHK(mime.InitCheck() == B_NO_INIT);
2368 CHK(mime.SetSupportedTypes(&msg, true) != B_OK);
2369 CHK(mime.SetSupportedTypes(&msg, false) != B_OK);
2370 CHK(mime.GetSupportedTypes(&msg) != B_OK);
2371 CHK(mime.DeleteSupportedTypes() != B_OK);
2380 BMimeType mime(testType);
2381 CHK(mime.InitCheck() == B_OK);
2382 if (!mime.IsInstalled())
2383 CHK(mime.Install() == B_OK);
2386 CHK(mime.SetSupportedTypes(&msg3, true) == B_OK);
2393 CHK(mime.Delete() == B_OK);
2408 BMimeType mime(testType);
2409 CHK(mime.InitCheck() == B_OK);
2412 if (mime.IsInstalled())
2413 CHK(mime.Delete() == B_OK);
2414 if (!mime.IsInstalled())
2415 CHK(mime.Install() == B_OK);
2416 CHK(mime.IsInstalled());
2419 CHK(mime.SetSupportedTypes(&msg3, true) == B_OK);
2420 CHK(mime.GetSupportedTypes(&msg) == B_OK);
2436 CHK(mime.SetSupportedTypes(&msg2, false) == B_OK);
2437 CHK(mime.GetSupportedTypes(&msg) == B_OK);
2454 CHK(mime.SetSupportedTypes(&msg1a, false) == B_OK);
2455 CHK(mime.GetSupportedTypes(&msg) == B_OK);
2473 CHK(mime.SetSupportedTypes(&msg1b, false) == B_OK);
2474 CHK(mime.GetSupportedTypes(&msg) == B_OK);
2491 CHK(mime.SetSupportedTypes(&msg1b, true) == B_OK);
2492 CHK(mime.GetSupportedTypes(&msg) == B_OK);
2507 CHK(mime.SetSupportedTypes(NULL, false) == B_OK);
2508 CHK(mime.GetSupportedTypes(&msg) == B_ENTRY_NOT_FOUND);
2517 CHK(mime.SetSupportedTypes(NULL, true) == B_ENTRY_NOT_FOUND);
2518 CHK(mime.GetSupportedTypes(&msg) == B_ENTRY_NOT_FOUND);
2536 BMimeType mime("application/octet-stream");
2537 CHK(mime.InitCheck() == B_OK);
2538 CHK(mime.GetSupportingApps(&msg) == B_OK);
2543 BMimeType mime("text");
2544 CHK(mime.InitCheck() == B_OK);
2545 CHK(mime.GetSupportingApps(&msg) == B_OK);
2550 BMimeType mime("text/html");
2551 CHK(mime.InitCheck() == B_OK);
2552 CHK(mime.GetSupportingApps(&msg) == B_OK);
2654 // any types appearing ONLY in the __mime_table and not in the mime
2678 BMimeType mime(type.c_str());
2679 CHK(mime.InitCheck() == B_OK);
2688 if (mime.GetSupertype(&superType) == B_OK)
2701 if (mime.GetPreferredApp(str) == B_OK) {
2709 CHK(mime.GetSupportingApps(&msg) == B_OK);
2737 BMimeType mime(wildcardType);
2738 CHK(mime.InitCheck() == B_OK);
2739 CHK(mime.GetSupportingApps(&msg2) == B_OK);
2994 { "unknown/mime-type", false, B_OK, },
3542 // by a nice, full mime update. :-)
3954 "application/x-vnd.obos.mime.test.test1",
3960 "application/x-vnd.obos.mime.test.test2",
3966 "application/x-vnd.obos.mime.test.test3",
4089 "application/x-vnd.obos.mime.test.test1",
4093 "application/x-vnd.obos.mime.test.test1",
4123 "application/x-vnd.obos.mime.test.test1",
4127 "application/x-vnd.obos.mime.test.test1",
4729 // meta mime test
4733 // real type ("application/x-vnd.be-meta-mime") which is concluded from the
4737 // "text/html", "application/x-vnd.be-meta-mime",
4739 // "fake-meta-mime-string"),