* Fixed warning.
* Automatic whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39632 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
876a4a3cae
commit
742d83e3d2
@ -8,14 +8,14 @@ StringAssignTest::StringAssignTest(std::string name) :
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
StringAssignTest::~StringAssignTest()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
StringAssignTest::PerformTest(void)
|
||||
{
|
||||
//=(BString&)
|
||||
@ -25,14 +25,14 @@ StringAssignTest::PerformTest(void)
|
||||
string = string2;
|
||||
CPPUNIT_ASSERT(strcmp(string.String(), string2.String()) == 0);
|
||||
CPPUNIT_ASSERT(strcmp(string.String(), "Something") == 0);
|
||||
|
||||
|
||||
//=(const char*)
|
||||
NextSubTest();
|
||||
BString *str = new BString();
|
||||
*str = "Something Else";
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), "Something Else") == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
//char ptr is NULL
|
||||
NextSubTest();
|
||||
char *s = NULL;
|
||||
@ -40,47 +40,47 @@ StringAssignTest::PerformTest(void)
|
||||
*str = s;
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), "") == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
//SetTo(const char *) (NULL)
|
||||
NextSubTest();
|
||||
str = new BString;
|
||||
str->SetTo(s);
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), "") == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
NextSubTest();
|
||||
str = new BString;
|
||||
str->SetTo("BLA");
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), "BLA") == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
//SetTo(BString&)
|
||||
NextSubTest();
|
||||
str = new BString;
|
||||
str->SetTo(string);
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), string.String()) == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
//SetTo(char, int32)
|
||||
NextSubTest();
|
||||
str = new BString;
|
||||
str->SetTo('C', 10);
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), "CCCCCCCCCC") == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
NextSubTest();
|
||||
str = new BString("ASDSGAFA");
|
||||
str->SetTo('C', 0);
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), "") == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
//SetTo(const char*, int32)
|
||||
NextSubTest();
|
||||
str = new BString;
|
||||
str->SetTo("ABC", 10);
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), "ABC") == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
//Adopt(BString&)
|
||||
NextSubTest();
|
||||
const char *oldString2 = string2.String();
|
||||
@ -89,10 +89,9 @@ StringAssignTest::PerformTest(void)
|
||||
CPPUNIT_ASSERT(strcmp(str->String(), oldString2) == 0);
|
||||
CPPUNIT_ASSERT(strcmp(string2.String(), "") == 0);
|
||||
delete str;
|
||||
|
||||
|
||||
NextSubTest();
|
||||
BString newstring("SomethingElseAgain");
|
||||
const char *oldString = newstring.String();
|
||||
str = new BString;
|
||||
str->Adopt(newstring, 2);
|
||||
CPPUNIT_ASSERT(strncmp(str->String(), "SomethingElseAgain", 2) == 0);
|
||||
@ -120,9 +119,9 @@ StringAssignTest::PerformTest(void)
|
||||
|
||||
|
||||
CppUnit::Test *StringAssignTest::suite(void)
|
||||
{
|
||||
{
|
||||
typedef CppUnit::TestCaller<StringAssignTest>
|
||||
StringAssignTestCaller;
|
||||
|
||||
|
||||
return(new StringAssignTestCaller("BString::Assign Test", &StringAssignTest::PerformTest));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user