1BMessenger()
2case 1:	IsValid() should return false.
3		IsTargetLocal() should return false.
4		Target() should return NULL and NULL for looper.
5		Team() should return -1.
6
7BMessenger(const BHandler *handler, const BLooper *looper, status_t *result)
8case 1:	handler is NULL, looper is NULL, result is NULL =>
9		IsValid() and IsTargetLocal() should return false
10		Target() should return NULL and NULL for looper.
11		Team() should return -1.
12case 2:	handler is NULL, looper is NULL, result is not NULL =>
13		IsValid() and IsTargetLocal() should return false.
14		Target() should return NULL and NULL for looper.
15		Team() should return -1.
16		result is set to B_BAD_VALUE.
17case 3:	handler is NULL, looper is not NULL, result is not NULL =>
18		IsValid() and IsTargetLocal() should return true.
19		Target() should return NULL and the correct value for looper.
20		Team() should return this team.
21		result is set to B_OK.
22case 4:	handler is not NULL, looper is NULL, result is not NULL,
23		handler doesn't belong to a looper =>
24		IsValid() and IsTargetLocal() should return false.
25		Target() should return NULL and NULL for looper.
26		Team() should return -1.
27		result is set to B_MISMATCHED_VALUES.
28case 5:	handler is not NULL, looper is NULL, result is not NULL
29		handler does belong to a looper =>
30		IsValid() and IsTargetLocal() should return true.
31		Target() should return the correct handler and handler->Looper()
32		for looper.
33		Team() should return this team.
34		result is set to B_OK.
35case 6:	handler is not NULL, looper is not NULL, result is not NULL
36		handler does belong to the looper =>
37		IsValid() and IsTargetLocal() should return true.
38		Target() should return the correct handler and the correct value
39		for looper.
40		Team() should return this team.
41		result is set to B_OK.
42case 7:	handler is not NULL, looper is not NULL, result is not NULL
43		handler does belong to a different looper =>
44		IsValid() and IsTargetLocal() should return false.
45		Target() should return NULL and NULL for looper.
46		Team() should return -1.
47		result is set to B_MISMATCHED_VALUES.
48
49BMessenger(const BMessenger &from)
50case 1:	from is uninitialized =>
51		IsValid() and IsTargetLocal() should return false
52		Target() should return NULL and NULL for looper.
53		Team() should return -1.
54case 2:	from is properly initialized to a local target =>
55		IsValid() and IsTargetLocal() should return true
56		Target() should return the same values as for from.
57		Team() should return this team.
58
59BMessenger(const char *signature, team_id team, status_t *result)
60case 1:	signature is NULL, team is -1, result is (not) NULL =>
61		IsValid() and IsTargetLocal() should return false
62		Target() should return NULL and NULL for looper.
63		Team() should return -1.
64		(result should be set to B_BAD_TYPE.)
65case 2:	signature is not NULL, but identifies no running application,
66		team is -1, result is (not) NULL =>
67		IsValid() and IsTargetLocal() should return false
68		Target() should return NULL and NULL for looper.
69		Team() should return -1.
70		(result should be set to B_BAD_VALUE.)
71case 3:	signature is NULL, team is > 0, but identifies no running application,
72		result is (not) NULL =>
73		IsValid() and IsTargetLocal() should return false
74		Target() should return NULL and NULL for looper.
75		Team() should return -1.
76		(result should be set to B_BAD_TEAM_ID.)
77case 4:	signature is not NULL and identifies a running B_ARGV_ONLY application,
78		team is -1, result is (not) NULL =>
79		IsValid() and IsTargetLocal() should return false
80		Target() should return NULL and NULL for looper.
81		Team() should return the remote app's team ID.
82		(result should be set to B_BAD_TYPE.)
83case 5:	signature is NULL,
84		team is > 0 and identifies a running B_ARGV_ONLY application,
85		result is (not) NULL =>
86		IsValid() and IsTargetLocal() should return false
87		Target() should return NULL and NULL for looper.
88		Team() should return the remote app's team ID.
89		(result should be set to B_BAD_TYPE.)
90case 6:	signature is not NULL and identifies a "normal" running application,
91		team is -1, result is (not) NULL =>
92		IsValid() should return true
93		IsTargetLocal() should return false
94		Target() should return NULL and NULL for looper.
95		Team() should return the team ID of the remote application.
96		(result should be set to B_OK.)
97case 7:	signature is NULL,
98		team is > 0 and identifies a "normal" running application,
99		result is (not) NULL =>
100		IsValid() should return true, false after the app terminated
101		IsTargetLocal() should return false
102		Target() should return NULL and NULL for looper.
103		Team() should return the team ID of the remote application (team).
104		(result should be set to B_OK.)
105case 8:	signature is not NULL and team is > 0, but both identify different
106		applications, result is (not) NULL =>
107		IsValid() and IsTargetLocal() should return false
108		Target() should return NULL and NULL for looper.
109		Team() should return -1.
110		(result should be set to B_MISMATCHED_VALUES.)
111case 9:	signature is not NULL,
112		team is > 0 and both identify the same application (more than one
113		app with the given signature are running), result is (not) NULL =>
114		IsValid() should return true
115		IsTargetLocal() should return false
116		Target() should return NULL and NULL for looper.
117		Team() should return the team ID of the remote application (team).
118		(result should be set to B_OK.)
119
120bool IsTargetLocal() const
121case 1:	this is uninitialized =>
122		should return false.
123case 2:	this is initialized to local target with preferred handler =>
124		should return true.
125case 3:	this is initialized to local target with specific handler =>
126		should return true.
127case 4:	this is initialized to local target with preferred handler =>
128		should return false.
129case 5:	this is initialized to remote target with specific handler =>
130		should return false.
131
132BHandler *Target(BLooper **looper) const
133case 1:	this is uninitialized, looper is NULL =>
134		should return NULL.
135case 2:	this is initialized to local target with preferred handler,
136		looper is NULL =>
137		should return NULL.
138case 3:	this is initialized to local target with specific handler,
139		looper is NULL =>
140		should return correct handler.
141case 4:	this is initialized to remote target with preferred handler,
142		looper is NULL =>
143		should return NULL.
144case 5:	this is initialized to remote target with specific handler,
145		looper is NULL =>
146		should return NULL.
147other cases included in BMessenger(...) cases
148
149bool LockTarget() const
150case 1:	this is uninitialized =>
151		should return false.
152case 2:	this is initialized to local target with preferred handler,
153		looper is not locked =>
154		should lock the looper and return true.
155case 3:	this is initialized to local target with specific handler,
156		looper is not locked =>
157		should lock the looper and return true.
158case 4:	this is initialized to local target with preferred handler,
159		looper is locked by another thread =>
160		should block until the looper is unlocked, lock it and return true.
161case 5:	this is initialized to local target with specific handler,
162		looper is locked by another thread =>
163		should block until the looper is unlocked, lock it and return true.
164case 6:	this is initialized to remote target with preferred handler,
165		looper is not locked =>
166		should not lock the looper and return false.
167case 7:	this is initialized to remote target with specific handler,
168		looper is not locked =>
169		should not lock the looper and return false.
170
171status_t LockTargetWithTimeout(bigtime_t timeout) const
172case 1:	this is uninitialized =>
173		should return B_BAD_VALUE.
174case 2:	this is initialized to local target with preferred handler,
175		looper is not locked =>
176		should lock the looper and return B_OK.
177case 3:	this is initialized to local target with specific handler,
178		looper is not locked =>
179		should lock the looper and return B_OK.
180case 4:	this is initialized to local target with preferred handler,
181		looper is locked by another thread, timeout is 100ms =>
182		should block until the looper is unlocked (after 50ms), lock it
183		and return B_OK.
184case 5:	this is initialized to local target with preferred handler,
185		looper is locked by another thread, timeout is 25ms =>
186		should block for 25ms, not until the looper is unlocked (after 50ms),
187		should return B_TIMED_OUT.
188case 6:	this is initialized to local target with specific handler,
189		looper is locked by another thread, timeout is 100ms =>
190		should block until the looper is unlocked (after 50ms), lock it
191		and return B_OK.
192case 7:	this is initialized to local target with specific handler,
193		looper is locked by another thread, timeout is 25ms =>
194		should block for 25ms, not until the looper is unlocked (after 50ms),
195		should return B_TIMED_OUT.
196case 8:	this is initialized to remote target with preferred handler,
197		looper is not locked =>
198		should not lock the looper and return B_BAD_VALUE.
199case 9:	this is initialized to remote target with specific handler,
200		looper is not locked =>
201		should not lock the looper and return B_BAD_VALUE.
202
203bool IsValid() const
204included in BMessenger(...) cases
205
206team_id Team() const
207included in BMessenger(...) cases
208
209BMessenger &operator=(const BMessenger &from)
210case 1:	from is uninitialized =>
211		IsValid() and IsTargetLocal() should return false
212		Target() should return NULL and NULL for looper.
213		Team() should return -1.
214case 2:	from is properly initialized to a local target (preferred handler) =>
215		IsValid() and IsTargetLocal() should return true
216		Target() should return the same values as for from.
217		Team() should return this team.
218case 3:	from is properly initialized to a local target (specific handler) =>
219		IsValid() and IsTargetLocal() should return true
220		Target() should return the same values as for from.
221		Team() should return this team.
222
223bool operator==(const BMessenger &other) const
224case 1:	this and other are uninitialized =>
225		should return true.
226case 2:	this is initialized, other is uninitialized, and vice versa =>
227		should return false.
228case 3:	this and other are initialized, different cases:
229		- same object => true
230		- different objects same target => true
231		- looper preferred handler vs. same looper but the looper itself as
232		  handler => false
233		- looper preferred handler vs. other looper preferred handler => false
234		- looper preferred handler vs. other looper specific handler => false
235		- local looper vs. remote looper => false
236
237bool operator!=(const BMessenger &a, const BMessenger &b)
238included in == cases
239
240bool operator<(const BMessenger &a, const BMessenger &b)
241case 1:	set fields of a and b manually =>
242		should return whatever the reference implementation returns.
243
244status_t SendMessage(uint32 command, BHandler *replyTo) const
245case 1:	this is uninitialized, replyTo is NULL =>
246		should return B_BAD_PORT_ID.
247case 2:	this is uninitialized, replyTo points to a valid handler  =>
248		should return B_BAD_PORT_ID.
249case 3:	this is initialized to a local/remote target with preferred/specific
250		handler, replyTo is NULL =>
251		should deliver the message and return B_OK.
252case 4:	this is initialized to a local/remote target with preferred/specific
253		handler, replyTo points to a valid handler =>
254		should deliver the message and return B_OK, a reply should be posted
255		to the reply handler.
256
257status_t SendMessage(BMessage *message, BHandler *replyTo,
258					 bigtime_t timeout) const
259case 1:	message is NULL, replyTo is NULL, timeout is B_INFINITE_TIMEOUT =>
260		should return B_BAD_VALUE.
261other cases similar to those of SendMessage(uint32, BHandler *). Each one with
262a timeout of B_INFINITE_TIMEOUT, 0 and some ms. For the last two
263timeouts in failure cases B_WOULD_BLOCK/B_TIMED_OUT should be returned.
264
265status_t SendMessage(BMessage *message, BMessenger replyTo,
266					 bigtime_t timeout) const
267cases similar to those of SendMessage(BMessage *, BHandler *, bigtime_t).
268An invalid replyTo messenger causes the same behavior as a NULL handler.
269
270status_t SendMessage(uint32 command, BMessage *reply) const
271case 1:	this is uninitialized, reply is NULL =>
272		should return B_BAD_PORT_ID or B_BAD_VALUE.
273case 2:	this is uninitialized, replyTo points to a valid message  =>
274		should return B_BAD_PORT_ID.
275case 3:	this is initialized to a local/remote target with preferred/specific
276		handler, reply is NULL =>
277		should return B_BAD_VALUE.
278case 4:	this is initialized to a local/remote target with preferred/specific
279		handler, reply points to a valid message =>
280		should deliver the message, wait for a reply and return B_OK,
281		reply should contain the reply.
282
283status_t SendMessage(BMessage *message, BMessage *reply,
284					 bigtime_t deliveryTimeout,
285					 bigtime_t replyTimeout) const
286cases similar to those of SendMessage(uint32, BMessage *). deliveryTimeout and
287replyTimeout are B_INFINITE_TIMEOUT, 0 or some ms. In timeout cases
288B_WOULD_BLOCK/B_TIMED_OUT should be returned.
289
290
291