tests/formatconverter/*.cpp
tests/geometry/*.cpp
tests/hashes/*.cpp
+tests/intl/*.cpp
+tests/intl/fr/internat.*
tests/lists/*.cpp
tests/longlong/*.cpp
tests/mbconv/*.cpp
test_fontmaptest.o \
test_formatconvertertest.o \
test_hashes.o \
+ test_intltest.o \
test_lists.o \
test_longlongtest.o \
test_convautotest.o \
### Targets: ###
-all: test$(EXEEXT) $(__test_gui___depname) $(__test_gui_bundle___depname) data printfbench$(EXEEXT)
+all: test$(EXEEXT) $(__test_gui___depname) $(__test_gui_bundle___depname) data fr printfbench$(EXEEXT)
install: all
esac; \
done
+fr:
+ @mkdir -p ./intl/fr
+ @for f in internat.po internat.mo; do \
+ if test ! -f ./intl/fr/$$f -a ! -d ./intl/fr/$$f ; \
+ then x=yep ; \
+ else x=`find $(srcdir)/intl/fr/$$f -newer ./intl/fr/$$f -print` ; \
+ fi; \
+ case "$$x" in ?*) \
+ cp -pRf $(srcdir)/intl/fr/$$f ./intl/fr ;; \
+ esac; \
+ done
+
printfbench$(EXEEXT): $(PRINTFBENCH_OBJECTS)
$(CXX) -o $@ $(PRINTFBENCH_OBJECTS) $(LDFLAGS) -L$(LIBDIRNAME) $(SAMPLES_RPATH_FLAG) $(CPPUNIT_LIBS) $(LIBS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE)
test_hashes.o: $(srcdir)/hashes/hashes.cpp $(TEST_ODEP)
$(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/hashes/hashes.cpp
+test_intltest.o: $(srcdir)/intl/intltest.cpp $(TEST_ODEP)
+ $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/intl/intltest.cpp
+
test_lists.o: $(srcdir)/lists/lists.cpp $(TEST_ODEP)
$(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/lists/lists.cpp
# Include dependency info, if present:
@IF_GNU_MAKE@-include .deps/*.d
-.PHONY: all install uninstall clean distclean test_gui_bundle data
+.PHONY: all install uninstall clean distclean test_gui_bundle data fr
--- /dev/null
+# Message catalog file template for the wxWindows i18n sample
+# Copyright (C) 1999 wxWindows development team
+# Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
+#
+#: internat.cpp:146
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: wxWindows 2.0 i18n sample\n"
+"POT-Creation-Date: 1999-01-13 18:19+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: internat.cpp:98
+msgid "International wxWindows App"
+msgstr "Application wxWindows internationale"
+
+#: internat.cpp:105
+msgid "&About..."
+msgstr "&A propos..."
+
+#: internat.cpp:107
+msgid "E&xit"
+msgstr "&Quitter"
+
+#: internat.cpp:110
+msgid "&Open bogus file"
+msgstr "&Ouvrir un fichier"
+
+#: internat.cpp:111
+msgid "&Play a game"
+msgstr "&Jouer"
+
+#: internat.cpp:114
+msgid "&File"
+msgstr "&Fichier"
+
+#: internat.cpp:115
+msgid "&Test"
+msgstr "&Test"
+
+#: internat.cpp:138
+msgid "I18n sample\n"
+"© 1998, 1999 Vadim Zeitlin and Julian Smart"
+msgstr "Exemple d'i18n\n"
+"© 1998, 1999 Vadim Zeitlin et Julian Smart"
+
+#: internat.cpp:139
+msgid "About Internat"
+msgstr "A propos d'Internat"
+
+#: internat.cpp:144
+msgid "Enter your number:"
+msgstr "Entrez votre numéro:"
+
+#: internat.cpp:145
+msgid "Try to guess my number!"
+msgstr "Essayez de déviner mon numéro!"
+
+#: internat.cpp:150
+msgid "You've probably entered an invalid number."
+msgstr "Vous avez probablement entré un nombre invalide."
+
+#: internat.cpp:154
+msgid "Bad luck! try again..."
+msgstr "Pas de chance! essayez encore..."
+
+#: internat.cpp:158
+msgid "Congratulations! you've won. Here is the magic phrase:"
+msgstr "Félicitations! vouz avez gagné. Voilà la phrase magique:"
+
+#: internat.cpp:162
+msgid "Result"
+msgstr "Resultat"
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: tests/intl/intltest.cpp
+// Purpose: wxLocale unit test
+// Author: Vaclav Slavik
+// Created: 2007-03-26
+// RCS-ID: $Id$
+// Copyright: (c) 2007 Vaclav Slavik
+///////////////////////////////////////////////////////////////////////////////
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#include "testprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif // WX_PRECOMP
+
+#include "wx/intl.h"
+
+#if wxUSE_INTL
+
+// ----------------------------------------------------------------------------
+// test class
+// ----------------------------------------------------------------------------
+
+class IntlTestCase : public CppUnit::TestCase
+{
+public:
+ IntlTestCase() {}
+
+ virtual void setUp();
+ virtual void tearDown();
+
+private:
+ CPPUNIT_TEST_SUITE( IntlTestCase );
+ CPPUNIT_TEST( Domain );
+ CPPUNIT_TEST( Headers );
+ CPPUNIT_TEST_SUITE_END();
+
+ void Domain();
+ void Headers();
+
+ wxLocale *m_locale;
+
+ DECLARE_NO_COPY_CLASS(IntlTestCase)
+};
+
+// register in the unnamed registry so that these tests are run by default
+CPPUNIT_TEST_SUITE_REGISTRATION( IntlTestCase );
+
+// also include in it's own registry so that these tests can be run alone
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( IntlTestCase, "IntlTestCase" );
+
+void IntlTestCase::setUp()
+{
+ wxLocale::AddCatalogLookupPathPrefix("./intl");
+
+ m_locale = new wxLocale;
+ // don't load default catalog, it may be unavailable:
+ bool loaded = m_locale->Init(wxLANGUAGE_FRENCH, wxLOCALE_CONV_ENCODING);
+ CPPUNIT_ASSERT( loaded );
+
+ m_locale->AddCatalog("internat");
+}
+
+void IntlTestCase::tearDown()
+{
+ delete m_locale;
+ m_locale = NULL;
+}
+
+void IntlTestCase::Domain()
+{
+ // _() searches all domains by default:
+ CPPUNIT_ASSERT( _("&Open bogus file") == "&Ouvrir un fichier" );
+
+ // search in our domain only:
+ CPPUNIT_ASSERT( wxGetTranslation("&Open bogus file", "internat") ==
+ "&Ouvrir un fichier" );
+
+ // search in a domain that doesn't have this string:
+ CPPUNIT_ASSERT( wxGetTranslation("&Open bogus file", "BogusDomain") ==
+ "&Open bogus file" );
+}
+
+void IntlTestCase::Headers()
+{
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("Project-Id-Version") ==
+ "wxWindows 2.0 i18n sample" );
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("POT-Creation-Date") ==
+ "1999-01-13 18:19+0100" );
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("PO-Revision-Date") ==
+ "YEAR-MO-DA HO:MI+ZONE" );
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("Last-Translator") ==
+ "Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>" );
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("MIME-Version") ==
+ "1.0" );
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("Content-Type") ==
+ "text/plain; charset=iso-8859-1" );
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("Content-Transfer-Encoding") ==
+ "8bit" );
+
+ // check that it fails with a bogus domain:
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("POT-Creation-Date", "Bogus") ==
+ "" );
+
+ // and that it fails for nonexisting header:
+ CPPUNIT_ASSERT( m_locale->GetHeaderValue("X-Not-Here") == "" );
+}
+
+#endif // wxUSE_INTL
$(OBJS)\test_fontmaptest.obj \
$(OBJS)\test_formatconvertertest.obj \
$(OBJS)\test_hashes.obj \
+ $(OBJS)\test_intltest.obj \
$(OBJS)\test_lists.obj \
$(OBJS)\test_longlongtest.obj \
$(OBJS)\test_convautotest.obj \
### Targets: ###
-all: $(OBJS)\test.exe $(__test_gui___depname) data $(OBJS)\printfbench.exe
+all: $(OBJS)\test.exe $(__test_gui___depname) data fr $(OBJS)\printfbench.exe
clean:
-if exist $(OBJS)\*.obj del $(OBJS)\*.obj
if not exist $(OBJS) mkdir $(OBJS)
for %f in (testdata.fc) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
+fr:
+ if not exist $(OBJS)\intl\fr mkdir $(OBJS)\intl\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 $(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 odbc32.lib import32.lib cw32$(__THREADSFLAG)$(__RUNTIME_LIBS_1).lib,,
$(OBJS)\test_hashes.obj: .\hashes\hashes.cpp
$(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
+$(OBJS)\test_intltest.obj: .\intl\intltest.cpp
+ $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
+
$(OBJS)\test_lists.obj: .\lists\lists.cpp
$(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
$(OBJS)\test_fontmaptest.o \
$(OBJS)\test_formatconvertertest.o \
$(OBJS)\test_hashes.o \
+ $(OBJS)\test_intltest.o \
$(OBJS)\test_lists.o \
$(OBJS)\test_longlongtest.o \
$(OBJS)\test_convautotest.o \
### Targets: ###
-all: $(OBJS)\test.exe $(__test_gui___depname) data $(OBJS)\printfbench.exe
+all: $(OBJS)\test.exe $(__test_gui___depname) data fr $(OBJS)\printfbench.exe
clean:
-if exist $(OBJS)\*.o del $(OBJS)\*.o
if not exist $(OBJS) mkdir $(OBJS)
for %%f in (testdata.fc) do if not exist $(OBJS)\%%f copy .\%%f $(OBJS)
+fr:
+ if not exist $(OBJS)\intl\fr mkdir $(OBJS)\intl\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) $(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 -lodbc32
$(OBJS)\test_hashes.o: ./hashes/hashes.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $<
+$(OBJS)\test_intltest.o: ./intl/intltest.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $<
+
$(OBJS)\test_lists.o: ./lists/lists.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\printfbench_printfbench.o: ./benchmarks/printfbench.cpp
$(CXX) -c -o $@ $(PRINTFBENCH_CXXFLAGS) $(CPPDEPS) $<
-.PHONY: all clean data
+.PHONY: all clean data fr
# Dependencies tracking:
$(OBJS)\test_fontmaptest.obj \
$(OBJS)\test_formatconvertertest.obj \
$(OBJS)\test_hashes.obj \
+ $(OBJS)\test_intltest.obj \
$(OBJS)\test_lists.obj \
$(OBJS)\test_longlongtest.obj \
$(OBJS)\test_convautotest.obj \
### Targets: ###
-all: $(OBJS)\test.exe $(__test_gui___depname) data $(OBJS)\printfbench.exe
+all: $(OBJS)\test.exe $(__test_gui___depname) data fr $(OBJS)\printfbench.exe
clean:
-if exist $(OBJS)\*.obj del $(OBJS)\*.obj
if not exist $(OBJS) mkdir $(OBJS)
for %f in (testdata.fc) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
+fr:
+ if not exist $(OBJS)\intl\fr mkdir $(OBJS)\intl\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:$@ $(LDFLAGS) $(__DEBUGINFO_2) $(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 odbc32.lib
$(OBJS)\test_hashes.obj: .\hashes\hashes.cpp
$(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
+$(OBJS)\test_intltest.obj: .\intl\intltest.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
+
$(OBJS)\test_lists.obj: .\lists\lists.cpp
$(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
$(OBJS)\test_fontmaptest.obj &
$(OBJS)\test_formatconvertertest.obj &
$(OBJS)\test_hashes.obj &
+ $(OBJS)\test_intltest.obj &
$(OBJS)\test_lists.obj &
$(OBJS)\test_longlongtest.obj &
$(OBJS)\test_convautotest.obj &
### Targets: ###
-all : .SYMBOLIC $(OBJS)\test.exe $(__test_gui___depname) data $(OBJS)\printfbench.exe
+all : .SYMBOLIC $(OBJS)\test.exe $(__test_gui___depname) data fr $(OBJS)\printfbench.exe
clean : .SYMBOLIC
-if exist $(OBJS)\*.obj del $(OBJS)\*.obj
if not exist $(OBJS) mkdir $(OBJS)
for %f in (testdata.fc) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
+fr : .SYMBOLIC
+ if not exist $(OBJS)\intl\fr mkdir $(OBJS)\intl\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)
@%create $(OBJS)\printfbench.lbc
@%append $(OBJS)\printfbench.lbc option quiet
$(OBJS)\test_hashes.obj : .AUTODEPEND .\hashes\hashes.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $<
+$(OBJS)\test_intltest.obj : .AUTODEPEND .\intl\intltest.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $<
+
$(OBJS)\test_lists.obj : .AUTODEPEND .\lists\lists.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $<
fontmap/fontmaptest.cpp
formatconverter/formatconvertertest.cpp
hashes/hashes.cpp
+ intl/intltest.cpp
lists/lists.cpp
longlong/longlongtest.cpp
mbconv/convautotest.cpp
<files>testdata.fc</files>
</wx-data>
+ <template id="catalog">
+ <dstdir>$(BUILDDIR)/intl/$(id)</dstdir>
+ <srcdir>$(SRCDIR)/intl/$(id)</srcdir>
+ <files>internat.po internat.mo</files>
+ </template>
+
+ <wx-data id="fr" template="catalog"/>
<!-- BENCHMARKS -->
# End Source File
# Begin Source File
+SOURCE=.\intl\intltest.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\streams\largefile.cpp
# End Source File
# Begin Source File