Added a test for BListView. There's little layout related to test, though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21381 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-06-10 16:54:49 +00:00
parent 9eae7400a4
commit 657c013bb0
4 changed files with 52 additions and 0 deletions

View File

@ -12,6 +12,7 @@ SimpleTest WidgetLayoutTest :
CheckBoxTest.cpp
ControlTest.cpp
GroupView.cpp
ListViewTest.cpp
RadioButton.cpp
StringView.cpp
Test.cpp

View File

@ -0,0 +1,24 @@
/*
* Copyright 2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
#include "ListViewTest.h"
#include <ListView.h>
#include <StringItem.h>
ListViewTest::ListViewTest()
: Test("ListView", NULL),
fListView(new BListView(BRect(0, 0, -1, -1), NULL))
{
SetView(fListView);
// add a view items
for (int32 i = 0; i < 15; i++) {
BString itemText("list item ");
itemText << i;
fListView->AddItem(new BStringItem(itemText.String()));
}
}

View File

@ -0,0 +1,24 @@
/*
* Copyright 2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef WIDGET_LAYOUT_TEST_LIST_VIEW_TEST_H
#define WIDGET_LAYOUT_TEST_LIST_VIEW_TEST_H
#include "Test.h"
class BListView;
class ListViewTest : public Test {
public:
ListViewTest();
private:
BListView* fListView;
};
#endif // WIDGET_LAYOUT_TEST_LIST_VIEW_TEST_H

View File

@ -13,6 +13,7 @@
#include "CheckBox.h"
#include "CheckBoxTest.h"
#include "GroupView.h"
#include "ListViewTest.h"
#include "StringView.h"
#include "Test.h"
#include "TwoDimensionalSliderView.h"
@ -276,6 +277,8 @@ main(int argc, const char* const* argv)
test = new ButtonTest;
} else if (strcmp(testName, "checkbox") == 0) {
test = new CheckBoxTest;
} else if (strcmp(testName, "listview") == 0) {
test = new ListViewTest;
} else {
fprintf(stderr, "Error: Invalid test name: \"%s\"\n", testName);
exit(1);