From 5261544b0d0ff95cfb3cc143234833e1b00285b2 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Sat, 29 Oct 2011 15:21:05 +0000 Subject: [PATCH] Applying patch for ticket #6134. Fixes BCursor tests. Thanks Karvjorm! And sorry for the delay. I also re-enabled the tests in the Jamfile (cf. r41788) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42955 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/kits/app/Jamfile | 4 +- src/tests/kits/app/bcursor/BCursorTester.cpp | 65 +++----------------- src/tests/kits/app/bcursor/BCursorTester.h | 2 - 3 files changed, 11 insertions(+), 60 deletions(-) diff --git a/src/tests/kits/app/Jamfile b/src/tests/kits/app/Jamfile index 9b4081be06..d6119891f0 100644 --- a/src/tests/kits/app/Jamfile +++ b/src/tests/kits/app/Jamfile @@ -53,8 +53,8 @@ UnitTestLib libapptest.so ReadWriteTester.cpp # BCursor -# BCursorTester.cpp -# CursorTest.cpp + BCursorTester.cpp + CursorTest.cpp # BHandler HandlerTest.cpp diff --git a/src/tests/kits/app/bcursor/BCursorTester.cpp b/src/tests/kits/app/bcursor/BCursorTester.cpp index d9b2a0da07..c585855c8d 100644 --- a/src/tests/kits/app/bcursor/BCursorTester.cpp +++ b/src/tests/kits/app/bcursor/BCursorTester.cpp @@ -1,27 +1,27 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- // BCursorTester.cpp // -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- -// Standard Includes ----------------------------------------------------------- +// Standard Includes ---------------------------------------------------------- -// System Includes ------------------------------------------------------------- +// System Includes ------------------------------------------------------------ #include #include #include #define CHK CPPUNIT_ASSERT -// Project Includes ------------------------------------------------------------ +// Project Includes ----------------------------------------------------------- -// Local Includes -------------------------------------------------------------- +// Local Includes ------------------------------------------------------------- #include "BCursorTester.h" -// Local Defines --------------------------------------------------------------- +// Local Defines -------------------------------------------------------------- -// Globals --------------------------------------------------------------------- +// Globals -------------------------------------------------------------------- -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- /* BCursor(const void *cursorData) @@ -174,49 +174,6 @@ void BCursorTester::Archive2() CHK(cur.Archive(&msg) == B_OK); } -/* - status_t Perform(perform_code d, void* arg) - @case 1 - @results return B_OK - */ -void BCursorTester::Perform1() -{ - BApplication app("application/x-vnd.cursortest"); - char data[68]; - int i; - - data[0] = 16; - data[1] = 1; - data[2] = 0; - data[3] = 0; - for (i=4; i<68; i++) - data[i] = 1; - - BCursor cur(data); - CHK(cur.Perform(0,NULL) == B_OK); -} - -/* - status_t Perform(perform_code d, void* arg) - @case 2 - @results return B_OK - */ -void BCursorTester::Perform2() -{ - BApplication app("application/x-vnd.cursortest"); - char data[68]; - int i; - - data[0] = 16; - data[1] = 1; - data[2] = 0; - data[3] = 0; - for (i=4; i<68; i++) - data[i] = 1; - - BCursor cur(data); - CHK(cur.Perform(0,&i) == B_OK); -} Test* BCursorTester::Suite() { @@ -231,11 +188,7 @@ Test* BCursorTester::Suite() ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Instantiate2); ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Archive1); ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Archive2); - ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Perform1); - ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Perform2); return SuiteOfTests; } - - diff --git a/src/tests/kits/app/bcursor/BCursorTester.h b/src/tests/kits/app/bcursor/BCursorTester.h index b564330c2e..94bc0e209e 100644 --- a/src/tests/kits/app/bcursor/BCursorTester.h +++ b/src/tests/kits/app/bcursor/BCursorTester.h @@ -34,8 +34,6 @@ class BCursorTester : public TestCase void Instantiate2(); void Archive1(); void Archive2(); - void Perform1(); - void Perform2(); static Test* Suite(); };