vfs: check userland buffers before reading them.
[haiku.git] / src / tests / kits / app / bmessage / MessageEasyFindTest.cpp
blob6961b38910b79b291f78cf14a68a8a5cb52d15c6
1 //------------------------------------------------------------------------------
2 // MessageEasyFindTest.cpp
3 //
4 //------------------------------------------------------------------------------
6 // Standard Includes -----------------------------------------------------------
8 // System Includes -------------------------------------------------------------
9 #include <Message.h>
10 #include <Point.h>
11 #include <Rect.h>
13 // Project Includes ------------------------------------------------------------
15 // Local Includes --------------------------------------------------------------
16 #include "MessageEasyFindTest.h"
18 // Local Defines ---------------------------------------------------------------
20 // Globals ---------------------------------------------------------------------
22 //------------------------------------------------------------------------------
23 void TMessageEasyFindTest::MessageEasyFindTest1()
25 BRect r(0, 0, -1, -1);
26 BPoint p(0, 0);
27 BMessage msg;
28 CPPUNIT_ASSERT(msg.FindRect("data") == r);
29 CPPUNIT_ASSERT(msg.FindPoint("data") == p);
30 CPPUNIT_ASSERT(msg.FindString("data") == NULL);
31 CPPUNIT_ASSERT(msg.FindInt8("data") == 0);
32 CPPUNIT_ASSERT(msg.FindInt16("data") == 0);
33 CPPUNIT_ASSERT(msg.FindInt32("data") == 0);
34 CPPUNIT_ASSERT(msg.FindInt64("data") == 0);
35 CPPUNIT_ASSERT(msg.FindBool("data") == false);
36 CPPUNIT_ASSERT(msg.FindFloat("data") == 0);
37 CPPUNIT_ASSERT(msg.FindDouble("data") == 0);
39 //------------------------------------------------------------------------------
40 TestSuite* TMessageEasyFindTest::Suite()
42 TestSuite* suite = new TestSuite("BMessage::EasyFinds");
44 ADD_TEST4(BMessage, suite, TMessageEasyFindTest, MessageEasyFindTest1);
46 return suite;
48 //------------------------------------------------------------------------------
51 * $Log $
53 * $Id $