BRoster::FindApp() tests added.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1075 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-09-17 21:22:57 +00:00
parent a88454a523
commit f236fcd129
2 changed files with 76 additions and 0 deletions
+74
View File
@@ -88,3 +88,77 @@ case 3: teamIDList is not NULL and not empty, signature is not NULL and
app(s) with this signature is (are) running => app(s) with this signature is (are) running =>
Should append the team IDs of all running apps with the supplied Should append the team IDs of all running apps with the supplied
signature to teamIDList. signature to teamIDList.
status_t FindApp(const char *mimeType, entry_ref *app) const
case 1: mimeType or app are NULL =>
Should return B_BAD_VALUE.
case 2: mimeType is invalid =>
Should return B_BAD_VALUE.
case 3: uninstalled type mimeType =>
Should return B_LAUNCH_FAILED_APP_NOT_FOUND.
case 4: installed type mimeType, no preferred app =>
Should return B_LAUNCH_FAILED_NO_PREFERRED_APP.
case 5: installed type mimeType, preferred app, app type not installed,
app has no signature =>
Should return B_LAUNCH_FAILED_APP_NOT_FOUND.
case 6: installed type mimeType, preferred app, app type not installed,
app has signature =>
Should return B_OK and set the ref to refer to the application's
executable. Should install the app type and set the app hint on it.
case 7: installed type mimeType, preferred app, app type installed,
app has signature =>
Should return B_OK and set the ref to refer to the application's
executable. Should set the app hint on the app type.
case 8: installed type mimeType, preferred app, app type installed,
app has signature, app has no execute permission =>
Should return B_OK and set the ref to refer to the application's
executable. Should set the app hint on the app type.
case 9: installed type mimeType, preferred app, app type installed,
two apps have the signature =>
Should return B_OK and set the ref to refer to the application
executable with the most recent modification time. Should set the app
hint on the app type.
case 10:installed type mimeType, preferred app, app type installed,
two apps have the signature, one has a version info, the other one is
newer =>
Should return B_OK and set the ref to refer to the application
executable with version info. Should set the app hint on the app type.
case 11:installed type mimeType, preferred app, app type installed,
two apps have the signature, both apps have a version info =>
Should return B_OK and set the ref to refer to the application
executable with the greater version. Should set the app
hint on the app type.
case 12:installed type mimeType, preferred app, app type installed,
preferred app type has an app hint that points to an app with a
different signature =>
Should return B_OK and set the ref to refer to the application's
executable. Should remove the incorrect app hint on the app type.
(OBOS: Should set the correct app hint.
Don't even return the wrong app?)
case 13:installed type mimeType, preferred app, app type installed,
preferred app type has an app hint pointing to void,
a differently named app with this signature exists =>
Should return B_OK and set the ref to refer to the application's
executable. (not R5: Should update the app hint on the app type?)
case 14:mimeType is app signature, not installed =>
Should return B_OK and set the ref to refer to the application
executable. Should set the app hint on the app type.
case 15:mimeType is installed, but has no preferred application,
super type has preferred application =>
Should return B_OK and set the ref to refer to the application
executable associated with the preferred app of the supertype.
Should set the app hint on the app type.
status_t FindApp(entry_ref *ref, entry_ref *app) const
case 1: ref or app are NULL =>
Should return B_BAD_VALUE.
case 2: ref doesn't refer to an existing entry =>
Should return B_ENTRY_NOT_FOUND.
cases: ref is valid, file has no type, sniffing results in a type,
type is set on file,
FindApp(const char*, entry_ref*) cases 2-15
cases: ref is valid, file has type,
FindApp(const char*, entry_ref*) cases 2-15
INVESTIGATE: NodeInfo::GetAppHint()/GetPreferredApp()/
BMimeType::GetPreferredApp()
@@ -1,4 +1,5 @@
#include "../common.h" #include "../common.h"
#include "FindAppTester.h"
#include "GetAppInfoTester.h" #include "GetAppInfoTester.h"
#include "GetAppListTester.h" #include "GetAppListTester.h"
#include "IsRunningTester.h" #include "IsRunningTester.h"
@@ -8,6 +9,7 @@ CppUnit::Test* RosterTestSuite()
{ {
CppUnit::TestSuite *testSuite = new CppUnit::TestSuite(); CppUnit::TestSuite *testSuite = new CppUnit::TestSuite();
testSuite->addTest(FindAppTester::Suite());
testSuite->addTest(GetAppInfoTester::Suite()); testSuite->addTest(GetAppInfoTester::Suite());
testSuite->addTest(GetAppListTester::Suite()); testSuite->addTest(GetAppListTester::Suite());
testSuite->addTest(IsRunningTester::Suite()); testSuite->addTest(IsRunningTester::Suite());