Added more tests for single button Alerts and added tests for two and three button Alerts.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11163 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
855c5b57b8
commit
aa44f14baa
@ -15,6 +15,10 @@
|
||||
|
||||
#define ASSERT_DEQUAL(x,y) CPPUNIT_ASSERT_DOUBLES_EQUAL((x),(y),0.01)
|
||||
|
||||
const char *k20X = "XXXXXXXXXXXXXXXXXXXX";
|
||||
const char *k40X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
|
||||
const char *k60X = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
|
||||
|
||||
// Required by CPPUNIT_ASSERT_EQUAL(rgb_color, rgb_color)
|
||||
bool operator==(const rgb_color &left, const rgb_color &right)
|
||||
{
|
||||
@ -236,17 +240,39 @@ AlertTest::Suite()
|
||||
CppUnit::TestSuite *suite = new CppUnit::TestSuite();
|
||||
typedef CppUnit::TestCaller<AlertTest> TC;
|
||||
|
||||
////// UW_ES_IA - One Button //////
|
||||
suite->addTest(
|
||||
new TC("Alert empty_empty_UW_ES_IA",
|
||||
&AlertTest::empty_empty_UW_ES_IA));
|
||||
|
||||
suite->addTest(
|
||||
new TC("Alert OK_X_UW_ES_IA",
|
||||
&AlertTest::OK_X_UW_ES_IA));
|
||||
|
||||
suite->addTest(
|
||||
new TC("Alert OK_60X_UW_ES_IA",
|
||||
&AlertTest::OK_60X_UW_ES_IA));
|
||||
suite->addTest(
|
||||
new TC("Alert twentyX_60X_UW_ES_IA",
|
||||
&AlertTest::twentyX_60X_UW_ES_IA));
|
||||
suite->addTest(
|
||||
new TC("Alert fortyX_60X_UW_ES_IA",
|
||||
&AlertTest::fortyX_60X_UW_ES_IA));
|
||||
|
||||
|
||||
////// UW_ES_IA - Two Button //////
|
||||
suite->addTest(
|
||||
new TC("Alert OK_Cancel_60X_UW_ES_IA",
|
||||
&AlertTest::OK_Cancel_60X_UW_ES_IA));
|
||||
suite->addTest(
|
||||
new TC("Alert twentyX_Cancel_60X_UW_ES_IA",
|
||||
&AlertTest::twentyX_Cancel_60X_UW_ES_IA));
|
||||
suite->addTest(
|
||||
new TC("Alert twentyX_20X_60X_UW_ES_IA",
|
||||
&AlertTest::twentyX_20X_60X_UW_ES_IA));
|
||||
|
||||
////// UW_ES_IA - Three Button //////
|
||||
suite->addTest(
|
||||
new TC("Alert twentyX_20X_20X_60X_UW_ES_IA",
|
||||
&AlertTest::twentyX_20X_20X_60X_UW_ES_IA));
|
||||
|
||||
return suite;
|
||||
}
|
||||
@ -265,6 +291,8 @@ AlertTest::tearDown()
|
||||
BTestCase::tearDown();
|
||||
}
|
||||
|
||||
////// UW_ES_IA - One Button //////
|
||||
|
||||
void
|
||||
AlertTest::empty_empty_UW_ES_IA()
|
||||
{
|
||||
@ -333,7 +361,7 @@ AlertTest::OK_60X_UW_ES_IA()
|
||||
wi.height = 77.0f;
|
||||
ati.SetWinInfo(wi);
|
||||
|
||||
ti.label = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
|
||||
ti.label = k60X;
|
||||
ti.width = 245.0f;
|
||||
ti.height = 26.0f;
|
||||
ti.topleft.Set(55.0f, 6.0f);
|
||||
@ -352,5 +380,207 @@ AlertTest::OK_60X_UW_ES_IA()
|
||||
ati.GuiInfoTest();
|
||||
}
|
||||
|
||||
void
|
||||
AlertTest::twentyX_60X_UW_ES_IA()
|
||||
{
|
||||
AlertTestInfo ati(this);
|
||||
GuiInfo wi, ti, bi;
|
||||
wi.label = "alert1";
|
||||
wi.width = 310.0f;
|
||||
wi.height = 77.0f;
|
||||
ati.SetWinInfo(wi);
|
||||
|
||||
ti.label = k60X;
|
||||
ti.width = 245.0f;
|
||||
ti.height = 26.0f;
|
||||
ti.topleft.Set(55.0f, 6.0f);
|
||||
ati.SetTextViewInfo(ti);
|
||||
|
||||
bi.label = k20X;
|
||||
bi.width = 160.0f;
|
||||
bi.height = 30.0f;
|
||||
bi.topleft.Set(144.0f, 41.0f);
|
||||
ati.SetButtonInfo(0, bi);
|
||||
|
||||
ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
|
||||
ati.SetButtonSpacingMode(B_EVEN_SPACING);
|
||||
ati.SetAlertType(B_INFO_ALERT);
|
||||
|
||||
ati.GuiInfoTest();
|
||||
}
|
||||
|
||||
void
|
||||
AlertTest::fortyX_60X_UW_ES_IA()
|
||||
{
|
||||
AlertTestInfo ati(this);
|
||||
GuiInfo wi, ti, bi;
|
||||
wi.label = "alert1";
|
||||
wi.width = 365.0f;
|
||||
wi.height = 77.0f;
|
||||
ati.SetWinInfo(wi);
|
||||
|
||||
ti.label = k60X;
|
||||
ti.width = 300.0f;
|
||||
ti.height = 26.0f;
|
||||
ti.topleft.Set(55.0f, 6.0f);
|
||||
ati.SetTextViewInfo(ti);
|
||||
|
||||
bi.label = k40X;
|
||||
bi.width = 300.0f;
|
||||
bi.height = 30.0f;
|
||||
bi.topleft.Set(59.0f, 41.0f);
|
||||
ati.SetButtonInfo(0, bi);
|
||||
|
||||
ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
|
||||
ati.SetButtonSpacingMode(B_EVEN_SPACING);
|
||||
ati.SetAlertType(B_INFO_ALERT);
|
||||
|
||||
ati.GuiInfoTest();
|
||||
}
|
||||
|
||||
////// UW_ES_IA - Two Button //////
|
||||
|
||||
void
|
||||
AlertTest::OK_Cancel_60X_UW_ES_IA()
|
||||
{
|
||||
AlertTestInfo ati(this);
|
||||
GuiInfo wi, ti, bi;
|
||||
wi.label = "alert1";
|
||||
wi.width = 310.0f;
|
||||
wi.height = 77.0f;
|
||||
ati.SetWinInfo(wi);
|
||||
|
||||
ti.label = k60X;
|
||||
ti.width = 245.0f;
|
||||
ti.height = 26.0f;
|
||||
ti.topleft.Set(55.0f, 6.0f);
|
||||
ati.SetTextViewInfo(ti);
|
||||
|
||||
bi.label = "OK";
|
||||
bi.width = 75.0f;
|
||||
bi.height = 24.0f;
|
||||
bi.topleft.Set(148.0f, 44.0f);
|
||||
ati.SetButtonInfo(0, bi);
|
||||
bi.label = "Cancel";
|
||||
bi.width = 75.0f;
|
||||
bi.height = 30.0f;
|
||||
bi.topleft.Set(229.0f, 41.0f);
|
||||
ati.SetButtonInfo(1, bi);
|
||||
|
||||
ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
|
||||
ati.SetButtonSpacingMode(B_EVEN_SPACING);
|
||||
ati.SetAlertType(B_INFO_ALERT);
|
||||
|
||||
ati.GuiInfoTest();
|
||||
}
|
||||
|
||||
void
|
||||
AlertTest::twentyX_Cancel_60X_UW_ES_IA()
|
||||
{
|
||||
AlertTestInfo ati(this);
|
||||
GuiInfo wi, ti, bi;
|
||||
wi.label = "alert1";
|
||||
wi.width = 310.0f;
|
||||
wi.height = 77.0f;
|
||||
ati.SetWinInfo(wi);
|
||||
|
||||
ti.label = k60X;
|
||||
ti.width = 245.0f;
|
||||
ti.height = 26.0f;
|
||||
ti.topleft.Set(55.0f, 6.0f);
|
||||
ati.SetTextViewInfo(ti);
|
||||
|
||||
bi.label = k20X;
|
||||
bi.width = 160.0f;
|
||||
bi.height = 24.0f;
|
||||
bi.topleft.Set(63.0f, 44.0f);
|
||||
ati.SetButtonInfo(0, bi);
|
||||
bi.label = "Cancel";
|
||||
bi.width = 75.0f;
|
||||
bi.height = 30.0f;
|
||||
bi.topleft.Set(229.0f, 41.0f);
|
||||
ati.SetButtonInfo(1, bi);
|
||||
|
||||
ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
|
||||
ati.SetButtonSpacingMode(B_EVEN_SPACING);
|
||||
ati.SetAlertType(B_INFO_ALERT);
|
||||
|
||||
ati.GuiInfoTest();
|
||||
}
|
||||
|
||||
void
|
||||
AlertTest::twentyX_20X_60X_UW_ES_IA()
|
||||
{
|
||||
AlertTestInfo ati(this);
|
||||
GuiInfo wi, ti, bi;
|
||||
wi.label = "alert1";
|
||||
wi.width = 394.0f;
|
||||
wi.height = 77.0f;
|
||||
ati.SetWinInfo(wi);
|
||||
|
||||
ti.label = k60X;
|
||||
ti.width = 329.0f;
|
||||
ti.height = 26.0f;
|
||||
ti.topleft.Set(55.0f, 6.0f);
|
||||
ati.SetTextViewInfo(ti);
|
||||
|
||||
bi.label = k20X;
|
||||
bi.width = 160.0f;
|
||||
bi.height = 24.0f;
|
||||
bi.topleft.Set(62.0f, 44.0f);
|
||||
ati.SetButtonInfo(0, bi);
|
||||
bi.label = k20X;
|
||||
bi.width = 160.0f;
|
||||
bi.height = 30.0f;
|
||||
bi.topleft.Set(228.0f, 41.0f);
|
||||
ati.SetButtonInfo(1, bi);
|
||||
|
||||
ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
|
||||
ati.SetButtonSpacingMode(B_EVEN_SPACING);
|
||||
ati.SetAlertType(B_INFO_ALERT);
|
||||
|
||||
ati.GuiInfoTest();
|
||||
}
|
||||
|
||||
////// UW_ES_IA - Three Button //////
|
||||
|
||||
void
|
||||
AlertTest::twentyX_20X_20X_60X_UW_ES_IA()
|
||||
{
|
||||
AlertTestInfo ati(this);
|
||||
GuiInfo wi, ti, bi;
|
||||
wi.label = "alert1";
|
||||
wi.width = 563.0f;
|
||||
wi.height = 64.0f;
|
||||
ati.SetWinInfo(wi);
|
||||
|
||||
ti.label = k60X;
|
||||
ti.width = 498.0f;
|
||||
ti.height = 13.0f;
|
||||
ti.topleft.Set(55.0f, 6.0f);
|
||||
ati.SetTextViewInfo(ti);
|
||||
|
||||
bi.label = k20X;
|
||||
bi.width = 160.0f;
|
||||
bi.height = 24.0f;
|
||||
bi.topleft.Set(62.0f, 31.0f);
|
||||
ati.SetButtonInfo(0, bi);
|
||||
bi.label = k20X;
|
||||
bi.width = 160.0f;
|
||||
bi.height = 24.0f;
|
||||
bi.topleft.Set(231.0f, 31.0f);
|
||||
ati.SetButtonInfo(1, bi);
|
||||
bi.label = k20X;
|
||||
bi.width = 160.0f;
|
||||
bi.height = 30.0f;
|
||||
bi.topleft.Set(397.0f, 28.0f);
|
||||
ati.SetButtonInfo(2, bi);
|
||||
|
||||
ati.SetButtonWidthMode(B_WIDTH_AS_USUAL);
|
||||
ati.SetButtonSpacingMode(B_EVEN_SPACING);
|
||||
ati.SetAlertType(B_INFO_ALERT);
|
||||
|
||||
ati.GuiInfoTest();
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,9 +44,24 @@ public:
|
||||
// LA = B_IDEA_ALERT
|
||||
// WA = B_WARNING_ALERT
|
||||
// SA = B_STOP_ALERT
|
||||
|
||||
////// UW_ES_IA - One Button //////
|
||||
|
||||
void empty_empty_UW_ES_IA();
|
||||
void OK_X_UW_ES_IA();
|
||||
void OK_60X_UW_ES_IA();
|
||||
void twentyX_60X_UW_ES_IA();
|
||||
void fortyX_60X_UW_ES_IA();
|
||||
|
||||
////// UW_ES_IA - Two Button //////
|
||||
|
||||
void OK_Cancel_60X_UW_ES_IA();
|
||||
void twentyX_Cancel_60X_UW_ES_IA();
|
||||
void twentyX_20X_60X_UW_ES_IA();
|
||||
|
||||
////// UW_ES_IA - Three Button //////
|
||||
|
||||
void twentyX_20X_20X_60X_UW_ES_IA();
|
||||
};
|
||||
|
||||
#endif // ALERT_TEST_H
|
||||
|
Loading…
Reference in New Issue
Block a user