Update of /cvsroot/wgui/wgui/includes/unit_tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19759/includes/unit_tests
Modified Files:
wg_window_unittests.h
Log Message:
Fixed a bug in the unit tests.
Index: wg_window_unittests.h
===================================================================
RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_window_unittests.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** wg_window_unittests.h 16 Jul 2004 16:41:35 -0000 1.10
--- wg_window_unittests.h 1 Sep 2004 19:22:02 -0000 1.11
***************
*** 51,63 ****
wGui::CWindow* pWindow1 = new wGui::CWindow(wGui::CRect(), 0);
! ensure("CWindow constructor", pWindow1->GetWindowRect() == wGui::CRect());
! ensure("CWindow constructor", pWindow1->GetAncestor(wGui::CWindow::PARENT) == 0);
! ensure("CWindow constructor", pWindow1->GetBackgroundColor() == wGui::DEFAULT_BACKGROUND_COLOR);
! ensure("CWindow constructor", pWindow1->IsVisible());
wGui::CWindow* pWindow2 = new wGui::CWindow(wGui::CRect(2, 4, 8, 16), pWindow1);
! ensure("CWindow constructor", pWindow2->GetWindowRect() == wGui::CRect(2, 4, 8, 16));
! ensure("CWindow constructor", pWindow2->GetAncestor(wGui::CWindow::PARENT) == pWindow1);
! ensure("CWindow constructor", pWindow2->GetClientRect() == wGui::CRect(2, 4, 8, 16));
// pWindow2 is a child of pWindow1, so we just need to delete pWindow1
delete pWindow1;
--- 51,63 ----
wGui::CWindow* pWindow1 = new wGui::CWindow(wGui::CRect(), 0);
! ensure("CWindow constructor - WindowRect", pWindow1->GetWindowRect() == wGui::CRect());
! ensure("CWindow constructor - Parent", pWindow1->GetAncestor(wGui::CWindow::PARENT) == 0);
! ensure("CWindow constructor - BGColor", pWindow1->GetBackgroundColor() == wGui::DEFAULT_BACKGROUND_COLOR);
! ensure("CWindow constructor - Visible", pWindow1->IsVisible());
wGui::CWindow* pWindow2 = new wGui::CWindow(wGui::CRect(2, 4, 8, 16), pWindow1);
! ensure("CWindow constructor - WindowRect (2nd)", pWindow2->GetWindowRect() == wGui::CRect(2, 4, 8, 16));
! ensure("CWindow constructor - Parent (2nd)", pWindow2->GetAncestor(wGui::CWindow::PARENT) == pWindow1);
! ensure("CWindow constructor - ClientRect (2nd)", pWindow2->GetClientRect() == wGui::CRect(0, 0, 6, 12));
// pWindow2 is a child of pWindow1, so we just need to delete pWindow1
delete pWindow1;
***************
*** 72,79 ****
pWindow1->SetWindowRect(wGui::CRect(3, 4, 5, 6));
ensure("CWindow SetWindowRect - WindowRect", pWindow1->GetWindowRect() == wGui::CRect(3, 4, 5, 6));
! ensure("CWindow SetWindowRect - ClientRect", pWindow1->GetClientRect() == wGui::CRect(3, 4, 3, 4));
pWindow1->MoveWindow(wGui::CPoint(-1, 1));
ensure("CWindow MoveWindow - WindowRect", pWindow1->GetWindowRect() == wGui::CRect(2, 5, 4, 7));
! ensure("CWindow MoveWindow - ClientRect", pWindow1->GetClientRect() == wGui::CRect(2, 5, 2, 5));
pWindow1->SetBackgroundColor(wGui::COLOR_YELLOW);
ensure("CWindow SetBackgroundColor", pWindow1->GetBackgroundColor() == wGui::COLOR_YELLOW);
--- 72,80 ----
pWindow1->SetWindowRect(wGui::CRect(3, 4, 5, 6));
ensure("CWindow SetWindowRect - WindowRect", pWindow1->GetWindowRect() == wGui::CRect(3, 4, 5, 6));
! // because we scale the size of the Client rect with the Window rect, but we start with zeros, it doesn't really scale in this case
! ensure("CWindow SetWindowRect - ClientRect", pWindow1->GetClientRect() == wGui::CRect());
pWindow1->MoveWindow(wGui::CPoint(-1, 1));
ensure("CWindow MoveWindow - WindowRect", pWindow1->GetWindowRect() == wGui::CRect(2, 5, 4, 7));
! ensure("CWindow MoveWindow - ClientRect", pWindow1->GetClientRect() == wGui::CRect());
pWindow1->SetBackgroundColor(wGui::COLOR_YELLOW);
ensure("CWindow SetBackgroundColor", pWindow1->GetBackgroundColor() == wGui::COLOR_YELLOW);
|