test_strings.o \
test_stdstrings.o \
test_unicode.o \
+ test_crt.o \
test_bstream.o \
test_ffilestream.o \
test_filestream.o \
data:
@mkdir -p .
@for f in testdata.fc; do \
- if test \( ! -s ./$$f \) -o \( $(srcdir)/$$f -nt ./$$f \) ; then \
- cp -pRf $(srcdir)/$$f . ; \
+ if test ! -e ./$$f ; \
+ then x=yep ; \
+ else x=`find $(srcdir)/$$f -newer ./$$f -print` ; \
fi; \
+ case "$$x" in ?*) \
+ cp -pRf $(srcdir)/$$f . ;; \
+ esac; \
done
test_test.o: $(srcdir)/test.cpp
test_unicode.o: $(srcdir)/strings/unicode.cpp
$(CXXC) -c -o $@ $(TEST_CXXFLAGS) $<
+test_crt.o: $(srcdir)/strings/crt.cpp
+ $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $<
+
test_bstream.o: $(srcdir)/streams/bstream.cpp
$(CXXC) -c -o $@ $(TEST_CXXFLAGS) $<
$(OBJS)\test_strings.obj \
$(OBJS)\test_stdstrings.obj \
$(OBJS)\test_unicode.obj \
+ $(OBJS)\test_crt.obj \
$(OBJS)\test_bstream.obj \
$(OBJS)\test_ffilestream.obj \
$(OBJS)\test_filestream.obj \
$(OBJS)\test_unicode.obj: .\strings\unicode.cpp
$(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
+$(OBJS)\test_crt.obj: .\strings\crt.cpp
+ $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
+
$(OBJS)\test_bstream.obj: .\streams\bstream.cpp
$(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
$(OBJS)\test_strings.o \
$(OBJS)\test_stdstrings.o \
$(OBJS)\test_unicode.o \
+ $(OBJS)\test_crt.o \
$(OBJS)\test_bstream.o \
$(OBJS)\test_ffilestream.o \
$(OBJS)\test_filestream.o \
$(OBJS)\test_unicode.o: ./strings/unicode.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+$(OBJS)\test_crt.o: ./strings/crt.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
$(OBJS)\test_bstream.o: ./streams/bstream.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
$(OBJS)\test_strings.obj \
$(OBJS)\test_stdstrings.obj \
$(OBJS)\test_unicode.obj \
+ $(OBJS)\test_crt.obj \
$(OBJS)\test_bstream.obj \
$(OBJS)\test_ffilestream.obj \
$(OBJS)\test_filestream.obj \
$(OBJS)\test_unicode.obj: .\strings\unicode.cpp
$(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
+$(OBJS)\test_crt.obj: .\strings\crt.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
+
$(OBJS)\test_bstream.obj: .\streams\bstream.cpp
$(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
!ifeq RUNTIME_LIBS static
__RUNTIME_LIBS_5 =
!endif
+__EXCEPTIONSFLAG_6 =
+!ifeq USE_EXCEPTIONS 0
+__EXCEPTIONSFLAG_6 =
+!endif
+!ifeq USE_EXCEPTIONS 1
+__EXCEPTIONSFLAG_6 = -xr
+!endif
__EXCEPTIONSFLAG_7 =
!ifeq USE_EXCEPTIONS 0
__EXCEPTIONSFLAG_7 =
TEST_CXXFLAGS = $(__DEBUGINFO_0) $(__OPTIMIZEFLAG_2) -bm $(__RUNTIME_LIBS_5) &
-d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) &
-i=.\..\include -i=$(SETUPHDIR) -i=. $(__DLLFLAG_p) $(CPPUNIT_CFLAGS) &
- $(__EXCEPTIONSFLAG_7) $(CPPFLAGS) $(CXXFLAGS)
+ $(__EXCEPTIONSFLAG_6) $(__EXCEPTIONSFLAG_7) $(CPPFLAGS) $(CXXFLAGS)
TEST_OBJECTS = &
$(OBJS)\test_test.obj &
$(OBJS)\test_main.obj &
$(OBJS)\test_strings.obj &
$(OBJS)\test_stdstrings.obj &
$(OBJS)\test_unicode.obj &
+ $(OBJS)\test_crt.obj &
$(OBJS)\test_bstream.obj &
$(OBJS)\test_ffilestream.obj &
$(OBJS)\test_filestream.obj &
$(OBJS)\test_unicode.obj : .AUTODEPEND .\strings\unicode.cpp
$(CXX) -zq -fo=$^@ $(TEST_CXXFLAGS) $<
+$(OBJS)\test_crt.obj : .AUTODEPEND .\strings\crt.cpp
+ $(CXX) -zq -fo=$^@ $(TEST_CXXFLAGS) $<
+
$(OBJS)\test_bstream.obj : .AUTODEPEND .\streams\bstream.cpp
$(CXX) -zq -fo=$^@ $(TEST_CXXFLAGS) $<
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: tests/strings/crt.cpp
+// Purpose: Test for wx C runtime functions wrappers
+// Author: Vaclav Slavik
+// Created: 2004-06-03
+// RCS-ID: $Id$
+// Copyright: (c) 2004 Vaclav Slavik
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif // WX_PRECOMP
+
+#include "wx/textfile.h"
+
+#include "wx/cppunit.h"
+
+// ----------------------------------------------------------------------------
+// test class
+// ----------------------------------------------------------------------------
+
+class CrtTestCase : public CppUnit::TestCase
+{
+public:
+ CrtTestCase() {}
+
+private:
+ CPPUNIT_TEST_SUITE( CrtTestCase );
+ CPPUNIT_TEST( SetGetEnv );
+ CPPUNIT_TEST_SUITE_END();
+
+ void SetGetEnv();
+
+ DECLARE_NO_COPY_CLASS(CrtTestCase)
+};
+
+// register in the unnamed registry so that these tests are run by default
+CPPUNIT_TEST_SUITE_REGISTRATION( CrtTestCase );
+
+// also include in it's own registry so that these tests can be run alone
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CrtTestCase, "CrtTestCase" );
+
+void CrtTestCase::SetGetEnv()
+{
+ wxString val;
+ wxSetEnv(_T("TESTVAR"), _T("value"));
+ CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), &val) == true );
+ CPPUNIT_ASSERT( val == _T("value") );
+ wxSetEnv(_T("TESTVAR"), _T("something else"));
+ CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), &val) );
+ CPPUNIT_ASSERT( val == _T("something else") );
+ CPPUNIT_ASSERT( wxUnsetEnv(_T("TESTVAR")) );
+ CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), NULL) == false );
+}
strings/strings.cpp
strings/stdstrings.cpp
strings/unicode.cpp
+ strings/crt.cpp
streams/bstream.cpp
streams/ffilestream.cpp
streams/filestream.cpp
# End Source File
# Begin Source File
+SOURCE=.\strings\crt.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\streams\ffilestream.cpp
# End Source File
# Begin Source File