extract wxTextEntry unit tests in a reusable base class

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-09-19 08:55:25 +00:00
parent 778ce4329a
commit f0f6a32d4d
12 changed files with 275 additions and 160 deletions

View File

@ -121,6 +121,7 @@ TEST_GUI_OBJECTS = \
test_gui_point.o \
test_gui_config.o \
test_gui_textctrltest.o \
test_gui_textentrytest.o \
test_gui_rawbmp.o \
test_gui_selstoretest.o \
test_gui_clientsize.o \
@ -180,10 +181,16 @@ COND_MONOLITHIC_0___WXLIB_XML_p = \
@COND_PLATFORM_MACOSX_1_USE_GUI_1@ = test_gui.app/Contents/PkgInfo
@COND_PLATFORM_MACOSX_1_USE_GUI_1@__test_gui_bundle___depname \
@COND_PLATFORM_MACOSX_1_USE_GUI_1@ = test_gui_bundle
@COND_TOOLKIT_COCOA@____test_gui_BUNDLE_TGT_REF_DEP = \
@COND_TOOLKIT_COCOA@ $(__test_gui_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_MAC@____test_gui_BUNDLE_TGT_REF_DEP = \
@COND_TOOLKIT_MAC@ $(__test_gui_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_OSX_CARBON@____test_gui_BUNDLE_TGT_REF_DEP \
@COND_TOOLKIT_OSX_CARBON@ = $(__test_gui_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_OSX_COCOA@____test_gui_BUNDLE_TGT_REF_DEP \
@COND_TOOLKIT_OSX_COCOA@ = $(__test_gui_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_OSX_IPHONE@____test_gui_BUNDLE_TGT_REF_DEP \
@COND_TOOLKIT_OSX_IPHONE@ = $(__test_gui_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_COCOA@____test_gui_BUNDLE_TGT_REF_DEP = \
@COND_TOOLKIT_COCOA@ $(__test_gui_app_Contents_PkgInfo___depname)
@COND_GCC_PCH_1@__test_gui_PCH_INC = -I.pch/testprec_test_gui
@COND_ICC_PCH_1@__test_gui_PCH_INC = -use_pch \
@COND_ICC_PCH_1@ .pch/testprec_test_gui/testprec.h.gch
@ -514,6 +521,9 @@ test_gui_config.o: $(srcdir)/config/config.cpp $(TEST_GUI_ODEP)
test_gui_textctrltest.o: $(srcdir)/controls/textctrltest.cpp $(TEST_GUI_ODEP)
$(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/textctrltest.cpp
test_gui_textentrytest.o: $(srcdir)/controls/textentrytest.cpp $(TEST_GUI_ODEP)
$(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/textentrytest.cpp
test_gui_rawbmp.o: $(srcdir)/image/rawbmp.cpp $(TEST_GUI_ODEP)
$(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/image/rawbmp.cpp

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
// Name: tests/textctrl/textctrltest.cpp
// Name: tests/controls/textctrltest.cpp
// Purpose: wxTextCtrl unit test
// Author: Vadim Zeitlin
// Created: 2007-09-25
@ -22,11 +22,13 @@
#include "wx/textctrl.h"
#endif // WX_PRECOMP
#include "textentrytest.h"
// ----------------------------------------------------------------------------
// test class
// ----------------------------------------------------------------------------
class TextCtrlTestCase : public CppUnit::TestCase
class TextCtrlTestCase : public TextEntryTestCase
{
public:
TextCtrlTestCase() { }
@ -35,24 +37,14 @@ public:
virtual void tearDown();
private:
virtual wxTextEntry *GetTestEntry() const { return m_text; }
virtual wxWindow *GetTestWindow() const { return m_text; }
CPPUNIT_TEST_SUITE( TextCtrlTestCase );
CPPUNIT_TEST( SetValue );
CPPUNIT_TEST( TextChangeEvents );
CPPUNIT_TEST( Selection );
CPPUNIT_TEST( InsertionPoint );
wxTEXT_ENTRY_TESTS();
CPPUNIT_TEST_SUITE_END();
void SetValue();
void TextChangeEvents();
void Selection();
void InsertionPoint();
// Selection() test helper: verify that selection is as described by the
// function parameters
void AssertSelection(int from, int to, const char *sel);
wxTextCtrl *m_text;
wxFrame *m_frame;
DECLARE_NO_COPY_CLASS(TextCtrlTestCase)
};
@ -82,132 +74,3 @@ void TextCtrlTestCase::tearDown()
// tests themselves
// ----------------------------------------------------------------------------
void TextCtrlTestCase::SetValue()
{
CPPUNIT_ASSERT( m_text->IsEmpty() );
m_text->SetValue("foo");
CPPUNIT_ASSERT_EQUAL( "foo", m_text->GetValue() );
m_text->SetValue("");
CPPUNIT_ASSERT( m_text->IsEmpty() );
m_text->SetValue("hi");
CPPUNIT_ASSERT_EQUAL( "hi", m_text->GetValue() );
m_text->SetValue("bye");
CPPUNIT_ASSERT_EQUAL( "bye", m_text->GetValue() );
}
void TextCtrlTestCase::TextChangeEvents()
{
class TextTestEventHandler : public wxEvtHandler
{
public:
TextTestEventHandler() { m_events = 0; }
// calling this automatically resets the events counter
int GetEvents()
{
const int events = m_events;
m_events = 0;
return events;
}
void OnText(wxCommandEvent& WXUNUSED(event)) { m_events++; }
private:
int m_events;
} handler;
m_text->Connect(wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler(TextTestEventHandler::OnText),
NULL,
&handler);
// notice that SetValue() generates an event even if the text didn't change
m_text->SetValue("");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
m_text->SetValue("foo");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
m_text->SetValue("foo");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
m_text->ChangeValue("bar");
CPPUNIT_ASSERT_EQUAL( 0, handler.GetEvents() );
m_text->AppendText("bar");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
m_text->Replace(3, 6, "baz");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
m_text->Remove(0, 3);
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
m_text->WriteText("foo");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
m_text->Clear();
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
}
void TextCtrlTestCase::AssertSelection(int from, int to, const char *sel)
{
CPPUNIT_ASSERT( m_text->HasSelection() );
long fromReal,
toReal;
m_text->GetSelection(&fromReal, &toReal);
CPPUNIT_ASSERT_EQUAL( from, fromReal );
CPPUNIT_ASSERT_EQUAL( to, toReal );
CPPUNIT_ASSERT_EQUAL( sel, m_text->GetStringSelection() );
CPPUNIT_ASSERT_EQUAL( from, m_text->GetInsertionPoint() );
}
void TextCtrlTestCase::Selection()
{
m_text->SetValue("0123456789");
m_text->SetSelection(2, 4);
AssertSelection(2, 4, "23"); // not "234"!
m_text->SetSelection(3, -1);
AssertSelection(3, 10, "3456789");
m_text->SelectAll();
AssertSelection(0, 10, "0123456789");
m_text->SetSelection(0, 0);
CPPUNIT_ASSERT( !m_text->HasSelection() );
}
void TextCtrlTestCase::InsertionPoint()
{
CPPUNIT_ASSERT_EQUAL( 0, m_text->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 0, m_text->GetInsertionPoint() );
m_text->SetValue("0"); // should put the insertion point in front
CPPUNIT_ASSERT_EQUAL( 1, m_text->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 0, m_text->GetInsertionPoint() );
m_text->AppendText("12"); // should update the insertion point position
CPPUNIT_ASSERT_EQUAL( 3, m_text->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 3, m_text->GetInsertionPoint() );
m_text->SetInsertionPoint(1);
CPPUNIT_ASSERT_EQUAL( 3, m_text->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 1, m_text->GetInsertionPoint() );
m_text->SetInsertionPointEnd();
CPPUNIT_ASSERT_EQUAL( 3, m_text->GetInsertionPoint() );
m_text->SetInsertionPoint(0);
m_text->WriteText("-"); // should move it after the written text
CPPUNIT_ASSERT_EQUAL( 4, m_text->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 1, m_text->GetInsertionPoint() );
}

View File

@ -0,0 +1,161 @@
///////////////////////////////////////////////////////////////////////////////
// Name: tests/controls/textentrytest.cpp
// Purpose: TestEntryTestCase implementation
// Author: Vadim Zeitlin
// Created: 2008-09-19 (extracted from textctrltest.cpp)
// RCS-ID: $Id$
// Copyright: (c) 2007, 2008 Vadim Zeitlin <vadim@wxwidgets.org>
///////////////////////////////////////////////////////////////////////////////
#include "testprec.h"
#ifndef WX_PRECOMP
#include "wx/event.h"
#include "wx/textentry.h"
#include "wx/window.h"
#endif // WX_PRECOMP
#include "textentrytest.h"
void TextEntryTestCase::SetValue()
{
wxTextEntry * const entry = GetTestEntry();
CPPUNIT_ASSERT( entry->IsEmpty() );
entry->SetValue("foo");
CPPUNIT_ASSERT_EQUAL( "foo", entry->GetValue() );
entry->SetValue("");
CPPUNIT_ASSERT( entry->IsEmpty() );
entry->SetValue("hi");
CPPUNIT_ASSERT_EQUAL( "hi", entry->GetValue() );
entry->SetValue("bye");
CPPUNIT_ASSERT_EQUAL( "bye", entry->GetValue() );
}
void TextEntryTestCase::TextChangeEvents()
{
class TextTestEventHandler : public wxEvtHandler
{
public:
TextTestEventHandler() { m_events = 0; }
// calling this automatically resets the events counter
int GetEvents()
{
const int events = m_events;
m_events = 0;
return events;
}
void OnText(wxCommandEvent& WXUNUSED(event)) { m_events++; }
private:
int m_events;
} handler;
GetTestWindow()->Connect
(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler(TextTestEventHandler::OnText),
NULL,
&handler
);
wxTextEntry * const entry = GetTestEntry();
// notice that SetValue() generates an event even if the text didn't change
entry->SetValue("");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
entry->SetValue("foo");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
entry->SetValue("foo");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
entry->ChangeValue("bar");
CPPUNIT_ASSERT_EQUAL( 0, handler.GetEvents() );
entry->AppendText("bar");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
entry->Replace(3, 6, "baz");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
entry->Remove(0, 3);
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
entry->WriteText("foo");
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
entry->Clear();
CPPUNIT_ASSERT_EQUAL( 1, handler.GetEvents() );
}
void TextEntryTestCase::AssertSelection(int from, int to, const char *sel)
{
wxTextEntry * const entry = GetTestEntry();
CPPUNIT_ASSERT( entry->HasSelection() );
long fromReal,
toReal;
entry->GetSelection(&fromReal, &toReal);
CPPUNIT_ASSERT_EQUAL( from, fromReal );
CPPUNIT_ASSERT_EQUAL( to, toReal );
CPPUNIT_ASSERT_EQUAL( sel, entry->GetStringSelection() );
CPPUNIT_ASSERT_EQUAL( from, entry->GetInsertionPoint() );
}
void TextEntryTestCase::Selection()
{
wxTextEntry * const entry = GetTestEntry();
entry->SetValue("0123456789");
entry->SetSelection(2, 4);
AssertSelection(2, 4, "23"); // not "234"!
entry->SetSelection(3, -1);
AssertSelection(3, 10, "3456789");
entry->SelectAll();
AssertSelection(0, 10, "0123456789");
entry->SetSelection(0, 0);
CPPUNIT_ASSERT( !entry->HasSelection() );
}
void TextEntryTestCase::InsertionPoint()
{
wxTextEntry * const entry = GetTestEntry();
CPPUNIT_ASSERT_EQUAL( 0, entry->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 0, entry->GetInsertionPoint() );
entry->SetValue("0"); // should put the insertion point in front
CPPUNIT_ASSERT_EQUAL( 1, entry->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 0, entry->GetInsertionPoint() );
entry->AppendText("12"); // should update the insertion point position
CPPUNIT_ASSERT_EQUAL( 3, entry->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 3, entry->GetInsertionPoint() );
entry->SetInsertionPoint(1);
CPPUNIT_ASSERT_EQUAL( 3, entry->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 1, entry->GetInsertionPoint() );
entry->SetInsertionPointEnd();
CPPUNIT_ASSERT_EQUAL( 3, entry->GetInsertionPoint() );
entry->SetInsertionPoint(0);
entry->WriteText("-"); // should move it after the written text
CPPUNIT_ASSERT_EQUAL( 4, entry->GetLastPosition() );
CPPUNIT_ASSERT_EQUAL( 1, entry->GetInsertionPoint() );
}

View File

@ -0,0 +1,55 @@
///////////////////////////////////////////////////////////////////////////////
// Name: tests/controls/textentrytest.h
// Purpose: Base class implementing wxTextEntry unit tests
// Author: Vadim Zeitlin
// Created: 2008-09-19 (extracted from textctrltest.cpp)
// RCS-ID: $Id$
// Copyright: (c) 2007, 2008 Vadim Zeitlin <vadim@wxwidgets.org>
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TESTS_CONTROLS_TEXTENTRYTEST_H_
#define _WX_TESTS_CONTROLS_TEXTENTRYTEST_H_
// ----------------------------------------------------------------------------
// abstract base class testing wxTextEntry methods
// ----------------------------------------------------------------------------
class TextEntryTestCase : public CppUnit::TestCase
{
public:
TextEntryTestCase() { }
protected:
// this function must be overridden by the derived classes to return the
// text entry object we're testing, typically this is done by creating a
// control implementing wxTextEntry interface in setUp() virtual method and
// just returning it from here
virtual wxTextEntry *GetTestEntry() const = 0;
// and this one must be overridden to return the window which implements
// wxTextEntry interface -- usually it will return the same pointer as
// GetTestEntry(), just as a different type
virtual wxWindow *GetTestWindow() const = 0;
// this should be inserted in the derived class CPPUNIT_TEST_SUITE
// definition to run all wxTextEntry tests as part of it
#define wxTEXT_ENTRY_TESTS() \
CPPUNIT_TEST( SetValue ); \
CPPUNIT_TEST( TextChangeEvents ); \
CPPUNIT_TEST( Selection ); \
CPPUNIT_TEST( InsertionPoint )
void SetValue();
void TextChangeEvents();
void Selection();
void InsertionPoint();
private:
// Selection() test helper: verify that selection is as described by the
// function parameters
void AssertSelection(int from, int to, const char *sel);
DECLARE_NO_COPY_CLASS(TextEntryTestCase)
};
#endif // _WX_TESTS_CONTROLS_TEXTENTRYTEST_H_

View File

@ -109,6 +109,7 @@ TEST_GUI_OBJECTS = \
$(OBJS)\test_gui_point.obj \
$(OBJS)\test_gui_config.obj \
$(OBJS)\test_gui_textctrltest.obj \
$(OBJS)\test_gui_textentrytest.obj \
$(OBJS)\test_gui_rawbmp.obj \
$(OBJS)\test_gui_selstoretest.obj \
$(OBJS)\test_gui_clientsize.obj \
@ -339,13 +340,13 @@ clean:
-if exist $(OBJS)\printfbench.ils del $(OBJS)\printfbench.ils
$(OBJS)\test.exe: $(OBJS)\test_dummy.obj $(TEST_OBJECTS)
ilink32 -Tpe -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) -ap $(CPPUNIT_LIBS) $(LDFLAGS) @&&|
ilink32 -Tpe -q $(LDFLAGS) -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) -ap $(CPPUNIT_LIBS) @&&|
c0x32.obj $(TEST_OBJECTS),$@,, $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_XML_p) $(__WXLIB_MONO_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) ole2w32.lib oleacc.lib import32.lib cw32$(__THREADSFLAG)$(__RUNTIME_LIBS_1).lib,,
|
!if "$(USE_GUI)" == "1"
$(OBJS)\test_gui.exe: $(OBJS)\test_gui_dummy.obj $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample.res
ilink32 -Tpe -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) $(CPPUNIT_LIBS) -ap $(LDFLAGS) @&&|
ilink32 -Tpe -q $(LDFLAGS) -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) $(CPPUNIT_LIBS) -ap @&&|
c0x32.obj $(TEST_GUI_OBJECTS),$@,, $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) ole2w32.lib oleacc.lib import32.lib cw32$(__THREADSFLAG)$(__RUNTIME_LIBS_1).lib,, $(OBJS)\test_gui_sample.res
|
!endif
@ -359,7 +360,7 @@ fr:
for %f in (internat.po internat.mo) do if not exist $(OBJS)\intl\fr\%f copy .\intl\fr\%f $(OBJS)\intl\fr
$(OBJS)\printfbench.exe: $(OBJS)\printfbench_dummy.obj $(PRINTFBENCH_OBJECTS)
ilink32 -Tpe -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) -ap $(CPPUNIT_LIBS) $(LDFLAGS) @&&|
ilink32 -Tpe -q $(LDFLAGS) -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) -ap $(CPPUNIT_LIBS) @&&|
c0x32.obj $(PRINTFBENCH_OBJECTS),$@,, $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) ole2w32.lib oleacc.lib import32.lib cw32$(__THREADSFLAG)$(__RUNTIME_LIBS_1).lib,,
|
@ -561,6 +562,9 @@ $(OBJS)\test_gui_config.obj: .\config\config.cpp
$(OBJS)\test_gui_textctrltest.obj: .\controls\textctrltest.cpp
$(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\textctrltest.cpp
$(OBJS)\test_gui_textentrytest.obj: .\controls\textentrytest.cpp
$(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\textentrytest.cpp
$(OBJS)\test_gui_rawbmp.obj: .\image\rawbmp.cpp
$(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\image\rawbmp.cpp

View File

@ -12,7 +12,7 @@ include ../build/msw/config.gcc
### Variables: ###
CPPDEPS = -MT$@ -MF$@.d -MD -MP
CPPDEPS = -MT$@ -MF$@.d -MD
WX_RELEASE_NODOT = 29
COMPILER_PREFIX = gcc
OBJS = \
@ -102,6 +102,7 @@ TEST_GUI_OBJECTS = \
$(OBJS)\test_gui_point.o \
$(OBJS)\test_gui_config.o \
$(OBJS)\test_gui_textctrltest.o \
$(OBJS)\test_gui_textentrytest.o \
$(OBJS)\test_gui_rawbmp.o \
$(OBJS)\test_gui_selstoretest.o \
$(OBJS)\test_gui_clientsize.o \
@ -323,11 +324,11 @@ clean:
-if exist $(OBJS)\printfbench.exe del $(OBJS)\printfbench.exe
$(OBJS)\test.exe: $(TEST_OBJECTS)
$(CXX) -o $@ $(TEST_OBJECTS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(LDFLAGS) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_XML_p) $(__WXLIB_MONO_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
$(CXX) -o $@ $(TEST_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_XML_p) $(__WXLIB_MONO_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
ifeq ($(USE_GUI),1)
$(OBJS)\test_gui.exe: $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample_rc.o
$(CXX) -o $@ $(TEST_GUI_OBJECTS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(LDFLAGS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
$(CXX) -o $@ $(TEST_GUI_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
endif
data:
@ -339,7 +340,7 @@ fr:
for %%f in (internat.po internat.mo) do if not exist $(OBJS)\intl\fr\%%f copy .\intl\fr\%%f $(OBJS)\intl\fr
$(OBJS)\printfbench.exe: $(PRINTFBENCH_OBJECTS)
$(CXX) -o $@ $(PRINTFBENCH_OBJECTS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(LDFLAGS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
$(CXX) -o $@ $(PRINTFBENCH_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
$(OBJS)\test_dummy.o: ./dummy.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $<
@ -539,6 +540,9 @@ $(OBJS)\test_gui_config.o: ./config/config.cpp
$(OBJS)\test_gui_textctrltest.o: ./controls/textctrltest.cpp
$(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\test_gui_textentrytest.o: ./controls/textentrytest.cpp
$(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\test_gui_rawbmp.o: ./image/rawbmp.cpp
$(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<

View File

@ -105,6 +105,7 @@ TEST_GUI_OBJECTS = \
$(OBJS)\test_gui_point.obj \
$(OBJS)\test_gui_config.obj \
$(OBJS)\test_gui_textctrltest.obj \
$(OBJS)\test_gui_textentrytest.obj \
$(OBJS)\test_gui_rawbmp.obj \
$(OBJS)\test_gui_selstoretest.obj \
$(OBJS)\test_gui_clientsize.obj \
@ -424,13 +425,13 @@ clean:
-if exist $(OBJS)\printfbench.pdb del $(OBJS)\printfbench.pdb
$(OBJS)\test.exe: $(OBJS)\test_dummy.obj $(TEST_OBJECTS)
link /NOLOGO /OUT:$@ $(__DEBUGINFO_2) /pdb:"$(OBJS)\test.pdb" $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:CONSOLE $(CPPUNIT_LIBS) $(LDFLAGS) @<<
link /NOLOGO /OUT:$@ $(LDFLAGS) $(__DEBUGINFO_2) /pdb:"$(OBJS)\test.pdb" $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:CONSOLE $(CPPUNIT_LIBS) @<<
$(TEST_OBJECTS) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_XML_p) $(__WXLIB_MONO_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib
<<
!if "$(USE_GUI)" == "1"
$(OBJS)\test_gui.exe: $(OBJS)\test_gui_dummy.obj $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample.res
link /NOLOGO /OUT:$@ $(__DEBUGINFO_2) /pdb:"$(OBJS)\test_gui.pdb" $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(CPPUNIT_LIBS) /SUBSYSTEM:CONSOLE $(LDFLAGS) @<<
link /NOLOGO /OUT:$@ $(LDFLAGS) $(__DEBUGINFO_2) /pdb:"$(OBJS)\test_gui.pdb" $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(CPPUNIT_LIBS) /SUBSYSTEM:CONSOLE @<<
$(TEST_GUI_OBJECTS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib
<<
!endif
@ -444,7 +445,7 @@ fr:
for %f in (internat.po internat.mo) do if not exist $(OBJS)\intl\fr\%f copy .\intl\fr\%f $(OBJS)\intl\fr
$(OBJS)\printfbench.exe: $(OBJS)\printfbench_dummy.obj $(PRINTFBENCH_OBJECTS)
link /NOLOGO /OUT:$@ $(__DEBUGINFO_2) /pdb:"$(OBJS)\printfbench.pdb" $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:CONSOLE $(CPPUNIT_LIBS) $(LDFLAGS) @<<
link /NOLOGO /OUT:$@ $(LDFLAGS) $(__DEBUGINFO_2) /pdb:"$(OBJS)\printfbench.pdb" $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:CONSOLE $(CPPUNIT_LIBS) @<<
$(PRINTFBENCH_OBJECTS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib
<<
@ -646,6 +647,9 @@ $(OBJS)\test_gui_config.obj: .\config\config.cpp
$(OBJS)\test_gui_textctrltest.obj: .\controls\textctrltest.cpp
$(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\textctrltest.cpp
$(OBJS)\test_gui_textentrytest.obj: .\controls\textentrytest.cpp
$(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\textentrytest.cpp
$(OBJS)\test_gui_rawbmp.obj: .\image\rawbmp.cpp
$(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\image\rawbmp.cpp

View File

@ -314,6 +314,7 @@ TEST_GUI_OBJECTS = &
$(OBJS)\test_gui_point.obj &
$(OBJS)\test_gui_config.obj &
$(OBJS)\test_gui_textctrltest.obj &
$(OBJS)\test_gui_textentrytest.obj &
$(OBJS)\test_gui_rawbmp.obj &
$(OBJS)\test_gui_selstoretest.obj &
$(OBJS)\test_gui_clientsize.obj &
@ -353,7 +354,7 @@ $(OBJS)\test.exe : $(TEST_OBJECTS)
@%append $(OBJS)\test.lbc option quiet
@%append $(OBJS)\test.lbc name $^@
@%append $(OBJS)\test.lbc option caseexact
@%append $(OBJS)\test.lbc $(__DEBUGINFO_2) libpath $(LIBDIRNAME) system nt ref 'main_' $(CPPUNIT_LIBS) $(LDFLAGS)
@%append $(OBJS)\test.lbc $(LDFLAGS) $(__DEBUGINFO_2) libpath $(LIBDIRNAME) system nt ref 'main_' $(CPPUNIT_LIBS)
@for %i in ($(TEST_OBJECTS)) do @%append $(OBJS)\test.lbc file %i
@for %i in ( $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_XML_p) $(__WXLIB_MONO_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__GDIPLUS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib) do @%append $(OBJS)\test.lbc library %i
@%append $(OBJS)\test.lbc
@ -366,7 +367,7 @@ $(OBJS)\test_gui.exe : $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample.res
@%append $(OBJS)\test_gui.lbc option quiet
@%append $(OBJS)\test_gui.lbc name $^@
@%append $(OBJS)\test_gui.lbc option caseexact
@%append $(OBJS)\test_gui.lbc $(__DEBUGINFO_2) libpath $(LIBDIRNAME) $(CPPUNIT_LIBS) system nt ref 'main_' $(LDFLAGS)
@%append $(OBJS)\test_gui.lbc $(LDFLAGS) $(__DEBUGINFO_2) libpath $(LIBDIRNAME) $(CPPUNIT_LIBS) system nt ref 'main_'
@for %i in ($(TEST_GUI_OBJECTS)) do @%append $(OBJS)\test_gui.lbc file %i
@for %i in ( $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__GDIPLUS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib) do @%append $(OBJS)\test_gui.lbc library %i
@%append $(OBJS)\test_gui.lbc option resource=$(OBJS)\test_gui_sample.res
@ -387,7 +388,7 @@ $(OBJS)\printfbench.exe : $(PRINTFBENCH_OBJECTS)
@%append $(OBJS)\printfbench.lbc option quiet
@%append $(OBJS)\printfbench.lbc name $^@
@%append $(OBJS)\printfbench.lbc option caseexact
@%append $(OBJS)\printfbench.lbc $(__DEBUGINFO_2) libpath $(LIBDIRNAME) system nt ref 'main_' $(CPPUNIT_LIBS) $(LDFLAGS)
@%append $(OBJS)\printfbench.lbc $(LDFLAGS) $(__DEBUGINFO_2) libpath $(LIBDIRNAME) system nt ref 'main_' $(CPPUNIT_LIBS)
@for %i in ($(PRINTFBENCH_OBJECTS)) do @%append $(OBJS)\printfbench.lbc file %i
@for %i in ( $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__GDIPLUS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib) do @%append $(OBJS)\printfbench.lbc library %i
@%append $(OBJS)\printfbench.lbc
@ -592,6 +593,9 @@ $(OBJS)\test_gui_config.obj : .AUTODEPEND .\config\config.cpp
$(OBJS)\test_gui_textctrltest.obj : .AUTODEPEND .\controls\textctrltest.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
$(OBJS)\test_gui_textentrytest.obj : .AUTODEPEND .\controls\textentrytest.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
$(OBJS)\test_gui_rawbmp.obj : .AUTODEPEND .\image\rawbmp.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<

View File

@ -101,6 +101,7 @@
geometry/point.cpp
config/config.cpp
controls/textctrltest.cpp
controls/textentrytest.cpp
image/rawbmp.cpp
misc/selstoretest.cpp
window/clientsize.cpp

View File

@ -283,6 +283,10 @@ SOURCE=.\test.cpp
SOURCE=.\controls\textctrltest.cpp
# End Source File
# Begin Source File
SOURCE=.\controls\textentrytest.cpp
# End Source File
# End Group
# End Target
# End Project

View File

@ -720,6 +720,8 @@
RelativePath=".\test.cpp"/>
<File
RelativePath=".\controls\textctrltest.cpp"/>
<File
RelativePath=".\controls\textentrytest.cpp"/>
</Filter>
<Filter
Name="Resource Files"

View File

@ -905,6 +905,9 @@
<File
RelativePath=".\controls\textctrltest.cpp"
/>
<File
RelativePath=".\controls\textentrytest.cpp"
/>
</Filter>
<Filter
Name="Resource Files"