xref: /haiku/src/tests/kits/app/bhandler/BHandlerCases (revision 13581b3d2a71545960b98fefebc5225b5bf29072)
1BHandler(const char* name)
2case 1:	name is non-NULL; BHandler::Name() should return that name
3case 2: name is NULL; BHandler::Name() should return NULL
4
5BHandler(BMessage* archive)
6case 1: if archive has field "_name", BHandler::Name() should return that name
7case 2: if archive has no field "_name", BHandler::Name() should return NULL
8case 3: archive is NULL
9
10Archive(BMessage *data, bool deep = true)
11case 1: data is NULL, deep is false
12case 2: data is NULL, deep is true
13case 3: data is valid, deep is false
14case 4: data is valid, deep is true
15
16Instantiate(BMessage *data)
17case 1: data is NULL
18case 2: data is valid, has field "_name"; BHandler::Name() should return that name
19case 3: data is valid, has no field "_name"; BHandler::Name() should return NULL
20
21SetName(const char *name)
22Name()
23case 1: name is NULL; BHandler::Name() should return NULL
24case 2: name is valid; BHandler::Name should return that name
25
26Perform(perform_code d, void *arg)
27case 1: feed meaningless data, should return B_ERROR
28
29IsWatched()
30case 1: No added watchers; should return false
31case 2: Add watcher, should return true; remove watcher, should return false
32case 3: Add watcher, should return true; send notice, remove watcher, should return false
33case 4: Remove watcher, should return false
34case 5: Send notices without watchers, should return false
35
36Looper()
37case 1: Not added to a BLooper, should return NULL
38case 2: Added to a BLooper, should return that BLooper;
39		remove from BLooper, should return NULL
40
41SetNextHandler(BHandler *handler)
42NextHandler()
43This BHandler and handler must be part of the same chain (i.e., belong to the
44same BLooper) and the BLooper they belong to must be locked.
45case 1: Handler1 and Handler2 do not belong to a BLooper
46case 2: Handler1 belongs to a BLooper (which is unlocked), Handler2 does not
47case 3: Handler1 belongs to a BLooper (which is locked), Handler2 does not
48case 4: Handler1 does not belong to a BLooper, Handler2 does (which is unlocked)
49case 5: Handler1 does not belong to a BLooper, Handler2 does (which is locked)
50case 6: Handler1 and Handler2 belong to different BLoopers, which are unlocked
51case 7: Handler1 and Handler2 belong to different BLoopers, and Handler1's
52		BLooper is locked; Handler2's is not
53case 8: Handler1 and Handler2 belong to different BLoopers, and Handler1's
54		BLooper is unlocked; Handler2's is locked
55case 9: Handler1 and Handler2 belong to different BLoopers, which are both locked
56case 10: Handler1 and Handler2 belong to the same BLooper, which is unlocked
57case 11: Handler1 and Handler2 belong to the same BLooper, which is locked
58case 12: Default constructed handler
59case 13: Handler belongs to BLooper
60
61AddFilter(BMessageFilter *filter)
62case 1: filter is NULL
63case 2: filter is valid, handler has no looper
64case 3: filter is valid, handler has looper, looper isn't locked
65case 4: filter is valid, handler has looper, looper is locked
66
67RemoveFilter(BMessageFilter *filter)
68case 1: filter is NULL
69case 2: filter is valid, handler has no looper
70case 3: filter is valid, handler has looper, looper isn't locked
71case 4: filter is valid, handler has looper, looper is locked
72case 5: filter is valid, but not owned by handler, handler has no looper
73case 6: filter is valid, but not owned by handler, handler has looper, looper isn't locked
74case 7: filter is valid, but not owned by handler, handler has looper, looper is locked
75
76SetFilterList(BList *filters)
77case 1: filters is NULL
78case 2: filters is valid, handler has no looper
79case 3: filters is valid, handler has looper, looper isn't locked
80case 4: filters is valid, handler has looper, looper is locked
81case 5: filters and handler are valid; then NULL filters is passed
82
83FilterList()
84case 1: default constructed BHandler
85Other cases are handled in SetFilterList() tests
86
87LockLooper()
88case 1: handler has no looper
89case 2: handler has a looper which is initially unlocked
90case 3: handler has a looper which is initially locked
91case 4: handler has a looper which is locked in another thread
92
93LockLooperWithTimeout(bigtime_t timeout)
94case 1: handler has no looper
95case 2: handler has a looper which is initially unlocked
96case 3: handler has a looper which is initially locked
97case 4: handler has a looper which is locked in another thread
98
99UnlockLooper()
100case 1: handler has no looper
101case 2: handler has a looper which is initially unlocked
102case 3: handler has a looper which is initially locked
103case 4: handler has a looper which is locked in another thread
104
105MessageReceived(BMessage *message)
106ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
107				 int32 form, const char *property)
108GetSupportedSuites(BMessage *data)
109StartWatching(BMessenger, uint32 what)
110StartWatchingAll(BMessenger)
111StopWatching(BMessenger, uint32 what)
112StopWatchingAll(BMessenger)
113StartWatching(BHandler *, uint32 what)
114StartWatchingAll(BHandler *)
115StopWatching(BHandler *, uint32 what)
116StopWatchingAll(BHandler *)
117
118SendNotices(uint32 what, const BMessage * = 0)
119