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
This commit is contained in:
@@ -53,8 +53,8 @@ UnitTestLib libapptest.so
|
|||||||
ReadWriteTester.cpp
|
ReadWriteTester.cpp
|
||||||
|
|
||||||
# BCursor
|
# BCursor
|
||||||
# BCursorTester.cpp
|
BCursorTester.cpp
|
||||||
# CursorTest.cpp
|
CursorTest.cpp
|
||||||
|
|
||||||
# BHandler
|
# BHandler
|
||||||
HandlerTest.cpp
|
HandlerTest.cpp
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
//------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// BCursorTester.cpp
|
// BCursorTester.cpp
|
||||||
//
|
//
|
||||||
//------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Standard Includes -----------------------------------------------------------
|
// Standard Includes ----------------------------------------------------------
|
||||||
|
|
||||||
// System Includes -------------------------------------------------------------
|
// System Includes ------------------------------------------------------------
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Cursor.h>
|
#include <Cursor.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
|
|
||||||
#define CHK CPPUNIT_ASSERT
|
#define CHK CPPUNIT_ASSERT
|
||||||
|
|
||||||
// Project Includes ------------------------------------------------------------
|
// Project Includes -----------------------------------------------------------
|
||||||
|
|
||||||
// Local Includes --------------------------------------------------------------
|
// Local Includes -------------------------------------------------------------
|
||||||
#include "BCursorTester.h"
|
#include "BCursorTester.h"
|
||||||
|
|
||||||
// Local Defines ---------------------------------------------------------------
|
// Local Defines --------------------------------------------------------------
|
||||||
|
|
||||||
// Globals ---------------------------------------------------------------------
|
// Globals --------------------------------------------------------------------
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
/*
|
/*
|
||||||
BCursor(const void *cursorData)
|
BCursor(const void *cursorData)
|
||||||
@@ -174,49 +174,6 @@ void BCursorTester::Archive2()
|
|||||||
CHK(cur.Archive(&msg) == B_OK);
|
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()
|
Test* BCursorTester::Suite()
|
||||||
{
|
{
|
||||||
@@ -231,11 +188,7 @@ Test* BCursorTester::Suite()
|
|||||||
ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Instantiate2);
|
ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Instantiate2);
|
||||||
ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Archive1);
|
ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Archive1);
|
||||||
ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Archive2);
|
ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Archive2);
|
||||||
ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Perform1);
|
|
||||||
ADD_TEST4(BCursor, SuiteOfTests, BCursorTester, Perform2);
|
|
||||||
|
|
||||||
return SuiteOfTests;
|
return SuiteOfTests;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ class BCursorTester : public TestCase
|
|||||||
void Instantiate2();
|
void Instantiate2();
|
||||||
void Archive1();
|
void Archive1();
|
||||||
void Archive2();
|
void Archive2();
|
||||||
void Perform1();
|
|
||||||
void Perform2();
|
|
||||||
|
|
||||||
static Test* Suite();
|
static Test* Suite();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user