]> git.saurik.com Git - wxWidgets.git/commitdiff
create tests/window directory for wxWindow tests
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 May 2008 02:56:22 +0000 (02:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 May 2008 02:56:22 +0000 (02:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/Makefile.in
tests/controls/clientsize.cpp [deleted file]
tests/makefile.bcc
tests/makefile.gcc
tests/makefile.vc
tests/makefile.wat
tests/test.bkl
tests/test_test_gui.dsp
tests/test_vc7_test_gui.vcproj
tests/test_vc8_test_gui.vcproj
tests/window/clientsize.cpp [new file with mode: 0644]

index 562680c0f7026da3f7900a5547d69c46136a3a1b..48b14a96e74caba1299b7309c7c2d8478ff89d97 100644 (file)
@@ -116,9 +116,9 @@ TEST_GUI_OBJECTS =  \
        test_gui_size.o \
        test_gui_point.o \
        test_gui_config.o \
-       test_gui_clientsize.o \
        test_gui_textctrltest.o \
-       test_gui_selstoretest.o
+       test_gui_selstoretest.o \
+       test_gui_clientsize.o
 TEST_GUI_ODEP =  $(___pch_testprec_test_gui_testprec_h_gch___depname)
 PRINTFBENCH_CXXFLAGS = $(__printfbench_PCH_INC) -D__WX$(TOOLKIT)__ \
        $(__WXUNIV_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
@@ -501,15 +501,15 @@ test_gui_point.o: $(srcdir)/geometry/point.cpp $(TEST_GUI_ODEP)
 test_gui_config.o: $(srcdir)/config/config.cpp $(TEST_GUI_ODEP)
        $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/config/config.cpp
 
-test_gui_clientsize.o: $(srcdir)/controls/clientsize.cpp $(TEST_GUI_ODEP)
-       $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/clientsize.cpp
-
 test_gui_textctrltest.o: $(srcdir)/controls/textctrltest.cpp $(TEST_GUI_ODEP)
        $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/textctrltest.cpp
 
 test_gui_selstoretest.o: $(srcdir)/misc/selstoretest.cpp $(TEST_GUI_ODEP)
        $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/misc/selstoretest.cpp
 
+test_gui_clientsize.o: $(srcdir)/window/clientsize.cpp $(TEST_GUI_ODEP)
+       $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/window/clientsize.cpp
+
 printfbench_printfbench.o: $(srcdir)/benchmarks/printfbench.cpp $(PRINTFBENCH_ODEP)
        $(CXXC) -c -o $@ $(PRINTFBENCH_CXXFLAGS) $(srcdir)/benchmarks/printfbench.cpp
 
diff --git a/tests/controls/clientsize.cpp b/tests/controls/clientsize.cpp
deleted file mode 100644 (file)
index 8f87ed9..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Name:        tests/controls/clientsize.cpp
-// Purpose:     Client vs. window size handling unit test
-// Author:      Vaclav Slavik
-// Created:     2008-02-12
-// RCS-ID:      $Id$
-// Copyright:   (c) 2008 Vaclav Slavik <vslavik@fastmail.fm>
-///////////////////////////////////////////////////////////////////////////////
-
-// ----------------------------------------------------------------------------
-// headers
-// ----------------------------------------------------------------------------
-
-#include "testprec.h"
-
-#ifdef __BORLANDC__
-    #pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-    #include "wx/app.h"
-    #include "wx/window.h"
-#endif // WX_PRECOMP
-
-// ----------------------------------------------------------------------------
-// test class
-// ----------------------------------------------------------------------------
-
-class ClientSizeTestCase : public CppUnit::TestCase
-{
-public:
-    ClientSizeTestCase() { }
-
-    virtual void setUp();
-    virtual void tearDown();
-
-private:
-    CPPUNIT_TEST_SUITE( ClientSizeTestCase );
-        CPPUNIT_TEST( ClientToWindow );
-        CPPUNIT_TEST( WindowToClient );
-    CPPUNIT_TEST_SUITE_END();
-
-    void ClientToWindow();
-    void WindowToClient();
-
-    wxWindow *m_win;
-
-    DECLARE_NO_COPY_CLASS(ClientSizeTestCase)
-};
-
-// register in the unnamed registry so that these tests are run by default
-CPPUNIT_TEST_SUITE_REGISTRATION( ClientSizeTestCase );
-
-// also include in it's own registry so that these tests can be run alone
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ClientSizeTestCase, "ClientSizeTestCase" );
-
-// ----------------------------------------------------------------------------
-// test initialization
-// ----------------------------------------------------------------------------
-
-void ClientSizeTestCase::setUp()
-{
-    m_win = wxTheApp->GetTopWindow();
-}
-
-void ClientSizeTestCase::tearDown()
-{
-    m_win = NULL;
-}
-
-// ----------------------------------------------------------------------------
-// tests themselves
-// ----------------------------------------------------------------------------
-
-void ClientSizeTestCase::ClientToWindow()
-{
-    CPPUNIT_ASSERT(m_win->GetSize() ==
-                   m_win->ClientToWindowSize(m_win->GetClientSize()));
-}
-
-void ClientSizeTestCase::WindowToClient()
-{
-    CPPUNIT_ASSERT(m_win->GetClientSize() ==
-                   m_win->WindowToClientSize(m_win->GetSize()));
-}
index ee35fe01e1a87675f2c7a536fd58f69fa7caea7b..2edcdf71d90f971658e4a822e0209d0b12993705 100644 (file)
@@ -103,9 +103,9 @@ TEST_GUI_OBJECTS =  \
        $(OBJS)\test_gui_size.obj \
        $(OBJS)\test_gui_point.obj \
        $(OBJS)\test_gui_config.obj \
-       $(OBJS)\test_gui_clientsize.obj \
        $(OBJS)\test_gui_textctrltest.obj \
-       $(OBJS)\test_gui_selstoretest.obj
+       $(OBJS)\test_gui_selstoretest.obj \
+       $(OBJS)\test_gui_clientsize.obj
 PRINTFBENCH_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \
        $(__OPTIMIZEFLAG) $(__THREADSFLAG_1) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \
        $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
@@ -536,15 +536,15 @@ $(OBJS)\test_gui_point.obj: .\geometry\point.cpp
 $(OBJS)\test_gui_config.obj: .\config\config.cpp
        $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\config\config.cpp
 
-$(OBJS)\test_gui_clientsize.obj: .\controls\clientsize.cpp
-       $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\clientsize.cpp
-
 $(OBJS)\test_gui_textctrltest.obj: .\controls\textctrltest.cpp
        $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\textctrltest.cpp
 
 $(OBJS)\test_gui_selstoretest.obj: .\misc\selstoretest.cpp
        $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\misc\selstoretest.cpp
 
+$(OBJS)\test_gui_clientsize.obj: .\window\clientsize.cpp
+       $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\window\clientsize.cpp
+
 $(OBJS)\printfbench_dummy.obj: .\dummy.cpp
        $(CXX) -q -c -P -o$@ $(PRINTFBENCH_CXXFLAGS) -H .\dummy.cpp
 
index 49dd117b90b31ff292a3699efa5a561ebd70bf73..7bf11401904c2f49779cbcd80d7122a97e438db7 100644 (file)
@@ -96,9 +96,9 @@ TEST_GUI_OBJECTS =  \
        $(OBJS)\test_gui_size.o \
        $(OBJS)\test_gui_point.o \
        $(OBJS)\test_gui_config.o \
-       $(OBJS)\test_gui_clientsize.o \
        $(OBJS)\test_gui_textctrltest.o \
-       $(OBJS)\test_gui_selstoretest.o
+       $(OBJS)\test_gui_selstoretest.o \
+       $(OBJS)\test_gui_clientsize.o
 PRINTFBENCH_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \
        $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \
        $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
@@ -514,15 +514,15 @@ $(OBJS)\test_gui_point.o: ./geometry/point.cpp
 $(OBJS)\test_gui_config.o: ./config/config.cpp
        $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
 
-$(OBJS)\test_gui_clientsize.o: ./controls/clientsize.cpp
-       $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
-
 $(OBJS)\test_gui_textctrltest.o: ./controls/textctrltest.cpp
        $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
 
 $(OBJS)\test_gui_selstoretest.o: ./misc/selstoretest.cpp
        $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
 
+$(OBJS)\test_gui_clientsize.o: ./window/clientsize.cpp
+       $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
+
 $(OBJS)\printfbench_dummy.o: ./dummy.cpp
        $(CXX) -c -o $@ $(PRINTFBENCH_CXXFLAGS) $(CPPDEPS) $<
 
index ada13d91f58d152f96b5c2421b1434b536851844..4a238a32959941f9fb6d8732c9ee2968be40a39c 100644 (file)
@@ -99,9 +99,9 @@ TEST_GUI_OBJECTS =  \
        $(OBJS)\test_gui_size.obj \
        $(OBJS)\test_gui_point.obj \
        $(OBJS)\test_gui_config.obj \
-       $(OBJS)\test_gui_clientsize.obj \
        $(OBJS)\test_gui_textctrltest.obj \
-       $(OBJS)\test_gui_selstoretest.obj
+       $(OBJS)\test_gui_selstoretest.obj \
+       $(OBJS)\test_gui_clientsize.obj
 PRINTFBENCH_CXXFLAGS = /M$(__RUNTIME_LIBS_38)$(__DEBUGRUNTIME) /DWIN32 \
        $(__DEBUGINFO) /Fd$(OBJS)\printfbench.pdb $(____DEBUGRUNTIME) \
        $(__OPTIMIZEFLAG) $(__NO_VC_CRTDBG_p) /D__WXMSW__ $(__WXUNIV_DEFINE_p) \
@@ -621,15 +621,15 @@ $(OBJS)\test_gui_point.obj: .\geometry\point.cpp
 $(OBJS)\test_gui_config.obj: .\config\config.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\config\config.cpp
 
-$(OBJS)\test_gui_clientsize.obj: .\controls\clientsize.cpp
-       $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\clientsize.cpp
-
 $(OBJS)\test_gui_textctrltest.obj: .\controls\textctrltest.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\textctrltest.cpp
 
 $(OBJS)\test_gui_selstoretest.obj: .\misc\selstoretest.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\misc\selstoretest.cpp
 
+$(OBJS)\test_gui_clientsize.obj: .\window\clientsize.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\window\clientsize.cpp
+
 $(OBJS)\printfbench_dummy.obj: .\dummy.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(PRINTFBENCH_CXXFLAGS) /Yctestprec.h .\dummy.cpp
 
index f17975db60d8f5b5fbff87d4e61f059499dce4df..4da93dc9fc9eb802358cce3ff045405447e4f541 100644 (file)
@@ -308,9 +308,9 @@ TEST_GUI_OBJECTS =  &
        $(OBJS)\test_gui_size.obj &
        $(OBJS)\test_gui_point.obj &
        $(OBJS)\test_gui_config.obj &
-       $(OBJS)\test_gui_clientsize.obj &
        $(OBJS)\test_gui_textctrltest.obj &
-       $(OBJS)\test_gui_selstoretest.obj
+       $(OBJS)\test_gui_selstoretest.obj &
+       $(OBJS)\test_gui_clientsize.obj
 PRINTFBENCH_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) &
        $(__RUNTIME_LIBS) -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) &
        $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) &
@@ -567,15 +567,15 @@ $(OBJS)\test_gui_point.obj :  .AUTODEPEND .\geometry\point.cpp
 $(OBJS)\test_gui_config.obj :  .AUTODEPEND .\config\config.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
 
-$(OBJS)\test_gui_clientsize.obj :  .AUTODEPEND .\controls\clientsize.cpp
-       $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
-
 $(OBJS)\test_gui_textctrltest.obj :  .AUTODEPEND .\controls\textctrltest.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
 
 $(OBJS)\test_gui_selstoretest.obj :  .AUTODEPEND .\misc\selstoretest.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
 
+$(OBJS)\test_gui_clientsize.obj :  .AUTODEPEND .\window\clientsize.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
+
 $(OBJS)\printfbench_dummy.obj :  .AUTODEPEND .\dummy.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(PRINTFBENCH_CXXFLAGS) $<
 
index 4d3d5caa3c28e85c9e9e43a71a49867a3f0572c4..b8b0475dc92372b5ec386027685a010df3ed1046 100644 (file)
@@ -95,9 +95,9 @@
             geometry/size.cpp
             geometry/point.cpp
             config/config.cpp
-            controls/clientsize.cpp
             controls/textctrltest.cpp
             misc/selstoretest.cpp
+            window/clientsize.cpp
         </sources>
         <wx-lib>core</wx-lib>
         <wx-lib>base</wx-lib>
index a7dc53936ea4ce39d6ef5953f84623b4219fc05a..ee5b74aea4b3c545163af10fa7bbb39db6a1eb98 100644 (file)
@@ -235,7 +235,7 @@ LINK32=link.exe
 # PROP Default_Filter ""\r
 # Begin Source File\r
 \r
-SOURCE=.\controls\clientsize.cpp\r
+SOURCE=.\window\clientsize.cpp\r
 # End Source File\r
 # Begin Source File\r
 \r
index 48f2e3594108762a01a12f7f88a64627b2fe8bc2..2a750e387942ffee9a1105b75abb850dc593c133 100644 (file)
                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
                        Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx">\r
                        <File\r
-                               RelativePath=".\controls\clientsize.cpp"/>\r
+                               RelativePath=".\window\clientsize.cpp"/>\r
                        <File\r
                                RelativePath=".\config\config.cpp"/>\r
                        <File\r
index 7e2bf795753d3b4d3393f930dc4c6f7a07b36209..4506ca485e77c86cf79db384f5f1be4958c328b4 100644 (file)
                        Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
                        >\r
                        <File\r
-                               RelativePath=".\controls\clientsize.cpp"\r
+                               RelativePath=".\window\clientsize.cpp"\r
                        />\r
                        <File\r
                                RelativePath=".\config\config.cpp"\r
diff --git a/tests/window/clientsize.cpp b/tests/window/clientsize.cpp
new file mode 100644 (file)
index 0000000..8f87ed9
--- /dev/null
@@ -0,0 +1,85 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        tests/controls/clientsize.cpp
+// Purpose:     Client vs. window size handling unit test
+// Author:      Vaclav Slavik
+// Created:     2008-02-12
+// RCS-ID:      $Id$
+// Copyright:   (c) 2008 Vaclav Slavik <vslavik@fastmail.fm>
+///////////////////////////////////////////////////////////////////////////////
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#include "testprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/window.h"
+#endif // WX_PRECOMP
+
+// ----------------------------------------------------------------------------
+// test class
+// ----------------------------------------------------------------------------
+
+class ClientSizeTestCase : public CppUnit::TestCase
+{
+public:
+    ClientSizeTestCase() { }
+
+    virtual void setUp();
+    virtual void tearDown();
+
+private:
+    CPPUNIT_TEST_SUITE( ClientSizeTestCase );
+        CPPUNIT_TEST( ClientToWindow );
+        CPPUNIT_TEST( WindowToClient );
+    CPPUNIT_TEST_SUITE_END();
+
+    void ClientToWindow();
+    void WindowToClient();
+
+    wxWindow *m_win;
+
+    DECLARE_NO_COPY_CLASS(ClientSizeTestCase)
+};
+
+// register in the unnamed registry so that these tests are run by default
+CPPUNIT_TEST_SUITE_REGISTRATION( ClientSizeTestCase );
+
+// also include in it's own registry so that these tests can be run alone
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ClientSizeTestCase, "ClientSizeTestCase" );
+
+// ----------------------------------------------------------------------------
+// test initialization
+// ----------------------------------------------------------------------------
+
+void ClientSizeTestCase::setUp()
+{
+    m_win = wxTheApp->GetTopWindow();
+}
+
+void ClientSizeTestCase::tearDown()
+{
+    m_win = NULL;
+}
+
+// ----------------------------------------------------------------------------
+// tests themselves
+// ----------------------------------------------------------------------------
+
+void ClientSizeTestCase::ClientToWindow()
+{
+    CPPUNIT_ASSERT(m_win->GetSize() ==
+                   m_win->ClientToWindowSize(m_win->GetClientSize()));
+}
+
+void ClientSizeTestCase::WindowToClient()
+{
+    CPPUNIT_ASSERT(m_win->GetClientSize() ==
+                   m_win->WindowToClientSize(m_win->GetSize()));
+}