Ticket #6134: BCursorTesterFix.patch
File BCursorTesterFix.patch, 3.5 KB (added by , 14 years ago) |
---|
-
src/tests/kits/app/bcursor/BCursorTester.cpp
1 //----------------------------------------------------------------------------- -1 //----------------------------------------------------------------------------- 2 2 // BCursorTester.cpp 3 3 // 4 //----------------------------------------------------------------------------- -4 //----------------------------------------------------------------------------- 5 5 6 // Standard Includes ---------------------------------------------------------- -6 // Standard Includes ---------------------------------------------------------- 7 7 8 // System Includes ------------------------------------------------------------ -8 // System Includes ------------------------------------------------------------ 9 9 #include <Application.h> 10 10 #include <Cursor.h> 11 11 #include <Message.h> 12 12 13 13 #define CHK CPPUNIT_ASSERT 14 14 15 // Project Includes ----------------------------------------------------------- -15 // Project Includes ----------------------------------------------------------- 16 16 17 // Local Includes ------------------------------------------------------------- -17 // Local Includes ------------------------------------------------------------- 18 18 #include "BCursorTester.h" 19 19 20 // Local Defines -------------------------------------------------------------- -20 // Local Defines -------------------------------------------------------------- 21 21 22 // Globals -------------------------------------------------------------------- -22 // Globals -------------------------------------------------------------------- 23 23 24 //----------------------------------------------------------------------------- -24 //----------------------------------------------------------------------------- 25 25 26 26 /* 27 27 BCursor(const void *cursorData) … … 174 174 CHK(cur.Archive(&msg) == B_OK); 175 175 } 176 176 177 /*178 status_t Perform(perform_code d, void* arg)179 @case 1180 @results return B_OK181 */182 void BCursorTester::Perform1()183 {184 BApplication app("application/x-vnd.cursortest");185 char data[68];186 int i;187 177 188 data[0] = 16;189 data[1] = 1;190 data[2] = 0;191 data[3] = 0;192 for (i=4; i<68; i++)193 data[i] = 1;194 195 BCursor cur(data);196 CHK(cur.Perform(0,NULL) == B_OK);197 }198 199 /*200 status_t Perform(perform_code d, void* arg)201 @case 2202 @results return B_OK203 */204 void BCursorTester::Perform2()205 {206 BApplication app("application/x-vnd.cursortest");207 char data[68];208 int i;209 210 data[0] = 16;211 data[1] = 1;212 data[2] = 0;213 data[3] = 0;214 for (i=4; i<68; i++)215 data[i] = 1;216 217 BCursor cur(data);218 CHK(cur.Perform(0,&i) == B_OK);219 }220 221 178 Test* BCursorTester::Suite() 222 179 { 223 180 TestSuite* SuiteOfTests = new TestSuite; … … 231 188 ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Instantiate2); 232 189 ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Archive1); 233 190 ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Archive2); 234 ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Perform1);235 ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Perform2);236 191 237 192 return SuiteOfTests; 238 193 } 239 194 240 241 -
src/tests/kits/app/bcursor/BCursorTester.h
34 34 void Instantiate2(); 35 35 void Archive1(); 36 36 void Archive2(); 37 void Perform1();38 void Perform2();39 37 40 38 static Test* Suite(); 41 39 };