forked from boostorg/regex
Added MFC/ATL wrappers.
Added support for unsigned versions in MSVC builds. More compiler-specific workarounds. [SVN r24351]
This commit is contained in:
1 parent
b0027d4b86
commit
f1ef6b6e9a
72 files changed
+2136
-1169
No files matched your search
@@ -17,6 +17,7 @@ test_deprecated.cpp
|
||||
test_escapes.cpp
|
||||
test_grep.cpp
|
||||
test_locale.cpp
|
||||
test_mfc.cpp
|
||||
test_non_greedy_repeats.cpp
|
||||
test_perl_ex.cpp
|
||||
test_replace.cpp
|
||||
|
||||
@@ -17,7 +17,8 @@ EX_SOURCES =
|
||||
w32_regex_traits.cpp
|
||||
wc_regex_traits.cpp
|
||||
wide_posix_api.cpp
|
||||
winstances.cpp ;
|
||||
winstances.cpp
|
||||
usinstances.cpp ;
|
||||
|
||||
lib boost_regex_extra : ../../src/$(EX_SOURCES) <template>../../build/regex-options
|
||||
:
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
|
||||
# very basic makefile for regress
|
||||
#
|
||||
# Borland C++ tools
|
||||
#
|
||||
# BCROOT defines the root directory of your bcb install
|
||||
#
|
||||
!ifndef BCROOT
|
||||
BCROOT=$(MAKEDIR)\..
|
||||
!endif
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
BCC32 = $(BCROOT)\bin\Bcc32.exe
|
||||
TLINK32 = $(BCROOT)\bin\ILink32.exe
|
||||
|
||||
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
|
||||
LINKOPTS= -ap -Tpe -x
|
||||
CFLAGS= -O2 -tWC -DSTRICT; -Vx -Ve -w-inl -w-aus -w-csu -w-eff -w-rch -I$(BCROOT)\include;..\..\..\..\; -L..\..\..\..\stage\lib -L..\..\build\bcb5
|
||||
|
||||
all :: r1.exe r2.exe r3.exe r4.exe r5.exe r6.exe r1m.exe r2m.exe r3m.exe r4m.exe r5m.exe r6m.exe r1l.exe r2l.exe r3l.exe r4l.exe r5l.exe r6l.exe r1lm.exe r2lm.exe r3lm.exe r4lm.exe r5lm.exe r6lm.exe
|
||||
echo testing static single threaded version....
|
||||
r1 tests.txt test1252.txt
|
||||
r2 tests.txt
|
||||
r3 tests.txt
|
||||
r4 tests.txt test1252.txt
|
||||
r5 tests.txt
|
||||
r6 tests.txt
|
||||
echo testing static multi-threaded version....
|
||||
r1m tests.txt test1252.txt
|
||||
r2m tests.txt
|
||||
r3m tests.txt
|
||||
r4m tests.txt test1252.txt
|
||||
r5m tests.txt
|
||||
r6m tests.txt
|
||||
echo testing dll single threaded version....
|
||||
r1l tests.txt test1252.txt
|
||||
r2l tests.txt
|
||||
r3l tests.txt
|
||||
r4l tests.txt test1252.txt
|
||||
r5l tests.txt
|
||||
r6l tests.txt
|
||||
echo testing dll multi-threaded version....
|
||||
r1lm tests.txt test1252.txt
|
||||
r2lm tests.txt
|
||||
r3lm tests.txt
|
||||
r4lm tests.txt test1252.txt
|
||||
r5lm tests.txt
|
||||
r6lm tests.txt
|
||||
|
||||
|
||||
r1.exe : tests.cpp regress.cpp parse.cpp
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er1.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
|
||||
|
||||
r2.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er2.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er3.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er4.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er5.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er6.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er1m.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er2m.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er3m.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er4m.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er5m.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er6m.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er1l.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er2l.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er3l.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er4l.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er5l.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er6l.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er1lm.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er2lm.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er3lm.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er4lm.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er5lm.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er6lm.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
|
||||
# very basic makefile for regress
|
||||
#
|
||||
# Borland C++ tools
|
||||
#
|
||||
# BCROOT defines the root directory of your bcb install
|
||||
#
|
||||
!ifndef BCROOT
|
||||
BCROOT=$(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
BCC32 = $(BCROOT)\bin\Bcc32.exe
|
||||
TLINK32 = $(BCROOT)\bin\ILink32.exe
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
|
||||
LINKOPTS= -ap -Tpe -x
|
||||
CFLAGS= -O2 -tWC -DSTRICT; -Vx -Ve -w-inl -w-aus -w-csu -w-eff -w-rch -I$(BCROOT)\include;..\..\..\..\; -L..\..\build\bcb4
|
||||
|
||||
all :: r1.exe r2.exe r3.exe r4.exe r5.exe r6.exe r1m.exe r2m.exe r3m.exe r4m.exe r5m.exe r6m.exe r1v.exe r2v.exe r3v.exe r4v.exe r5v.exe r6v.exe r1l.exe r2l.exe r3l.exe r4l.exe r5l.exe r6l.exe r1lm.exe r2lm.exe r3lm.exe r4lm.exe r5lm.exe r6lm.exe r1lv.exe r2lv.exe r3lv.exe r4lv.exe r5lv.exe r6lv.exe
|
||||
echo testing static single threaded version....
|
||||
r1 tests.txt test1252.txt
|
||||
r2 tests.txt
|
||||
r3 tests.txt
|
||||
r4 tests.txt test1252.txt
|
||||
r5 tests.txt
|
||||
r6 tests.txt
|
||||
echo testing static multi-threaded version....
|
||||
r1m tests.txt test1252.txt
|
||||
r2m tests.txt
|
||||
r3m tests.txt
|
||||
r4m tests.txt test1252.txt
|
||||
r5m tests.txt
|
||||
r6m tests.txt
|
||||
echo testing static VCL version....
|
||||
r1v tests.txt test1252.txt
|
||||
r2v tests.txt
|
||||
r3v tests.txt
|
||||
r4v tests.txt test1252.txt
|
||||
r5v tests.txt
|
||||
r6v tests.txt
|
||||
echo testing dll single threaded version....
|
||||
r1l tests.txt test1252.txt
|
||||
r2l tests.txt
|
||||
r3l tests.txt
|
||||
r4l tests.txt test1252.txt
|
||||
r5l tests.txt
|
||||
r6l tests.txt
|
||||
echo testing dll multi-threaded version....
|
||||
r1lm tests.txt test1252.txt
|
||||
r2lm tests.txt
|
||||
r3lm tests.txt
|
||||
r4lm tests.txt test1252.txt
|
||||
r5lm tests.txt
|
||||
r6lm tests.txt
|
||||
echo testing dll VCL version....
|
||||
r1lv tests.txt test1252.txt
|
||||
r2lv tests.txt
|
||||
r3lv tests.txt
|
||||
r4lv tests.txt test1252.txt
|
||||
r5lv tests.txt
|
||||
r6lv tests.txt
|
||||
|
||||
|
||||
r1.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er1.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er2.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er3.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er4.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er5.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er6.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er1m.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er2m.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er3m.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er4m.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er5m.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er6m.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er1v.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er2v.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er3v.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er4v.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er5v.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er6v.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er1l.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er2l.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er3l.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er4l.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er5l.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er6l.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er1lm.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er2lm.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er3lm.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er4lm.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er5lm.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er6lm.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er1lv.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er2lv.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er3lv.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er4lv.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er5lv.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er6lv.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
|
||||
# very basic makefile for regress
|
||||
#
|
||||
# Borland C++ tools
|
||||
#
|
||||
# BCROOT defines the root directory of your bcb install
|
||||
#
|
||||
!ifndef BCROOT
|
||||
BCROOT=$(MAKEDIR)\..
|
||||
!endif
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
BCC32 = $(BCROOT)\bin\Bcc32.exe
|
||||
TLINK32 = $(BCROOT)\bin\ILink32.exe
|
||||
|
||||
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
|
||||
LINKOPTS= -ap -Tpe -x
|
||||
CFLAGS= -O2 -tWC -DSTRICT; -Vx -Ve -w-inl -w-aus -w-csu -w-eff -w-rch -I$(BCROOT)\include;..\..\..\..\; -L..\..\..\..\stage\lib -L..\..\build\bcb5 $(CXXFLAGS)
|
||||
|
||||
all :: r1.exe r2.exe r3.exe r4.exe r5.exe r6.exe r1m.exe r2m.exe r3m.exe r4m.exe r5m.exe r6m.exe r1v.exe r2v.exe r3v.exe r4v.exe r5v.exe r6v.exe r1l.exe r2l.exe r3l.exe r4l.exe r5l.exe r6l.exe r1lm.exe r2lm.exe r3lm.exe r4lm.exe r5lm.exe r6lm.exe r1lv.exe r2lv.exe r3lv.exe r4lv.exe r5lv.exe r6lv.exe
|
||||
echo testing static single threaded version....
|
||||
r1 tests.txt test1252.txt
|
||||
r2 tests.txt
|
||||
r3 tests.txt
|
||||
r4 tests.txt test1252.txt
|
||||
r5 tests.txt
|
||||
r6 tests.txt
|
||||
echo testing static multi-threaded version....
|
||||
r1m tests.txt test1252.txt
|
||||
r2m tests.txt
|
||||
r3m tests.txt
|
||||
r4m tests.txt test1252.txt
|
||||
r5m tests.txt
|
||||
r6m tests.txt
|
||||
echo testing static VCL version....
|
||||
r1v tests.txt test1252.txt
|
||||
r2v tests.txt
|
||||
r3v tests.txt
|
||||
r4v tests.txt test1252.txt
|
||||
r5v tests.txt
|
||||
r6v tests.txt
|
||||
echo testing dll single threaded version....
|
||||
r1l tests.txt test1252.txt
|
||||
r2l tests.txt
|
||||
r3l tests.txt
|
||||
r4l tests.txt test1252.txt
|
||||
r5l tests.txt
|
||||
r6l tests.txt
|
||||
echo testing dll multi-threaded version....
|
||||
r1lm tests.txt test1252.txt
|
||||
r2lm tests.txt
|
||||
r3lm tests.txt
|
||||
r4lm tests.txt test1252.txt
|
||||
r5lm tests.txt
|
||||
r6lm tests.txt
|
||||
echo testing dll VCL version....
|
||||
r1lv tests.txt test1252.txt
|
||||
r2lv tests.txt
|
||||
r3lv tests.txt
|
||||
r4lv tests.txt test1252.txt
|
||||
r5lv tests.txt
|
||||
r6lv tests.txt
|
||||
|
||||
|
||||
r1.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er1.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er2.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er3.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er4.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er5.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er6.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er1m.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er2m.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er3m.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er4m.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er5m.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6m.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er6m.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er1v.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er2v.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er3v.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er4v.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er5v.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6v.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWV $(CFLAGS) -er6v.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er1l.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er2l.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er3l.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er4l.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er5l.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6l.exe : $(SOURCES)
|
||||
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er6l.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er1lm.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er2lm.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er3lm.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er4lm.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er5lm.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6lm.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er6lm.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
r1lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er1lv.exe -DBOOST_RE_TEST_LOCALE_W32 $(SOURCES)
|
||||
|
||||
r2lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er2lv.exe -DBOOST_RE_TEST_LOCALE_C $(SOURCES)
|
||||
|
||||
r3lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er3lv.exe -DBOOST_RE_TEST_LOCALE_CPP $(SOURCES)
|
||||
|
||||
r4lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er4lv.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r5lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er5lv.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
r6lv.exe : $(SOURCES)
|
||||
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er6lv.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ BCROOT=$(MAKEDIR)\..
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
SOURCES=*.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
BCC32 = $(BCROOT)\bin\Bcc32.exe
|
||||
TLINK32 = $(BCROOT)\bin\ILink32.exe
|
||||
@@ -204,5 +204,6 @@ r6lv.exe : $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ CXX= g++ $(INCLUDES) -L../../../../stage/lib -I../../../../ -I./ $(CXXFLAGS) -L.
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
SOURCES=*.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
total : gcc_regress
|
||||
export LD_LIBRARY_PATH="../../build/gcc:$LD_LIBRARY_PATH" && ./gcc_regress tests.txt
|
||||
@@ -63,5 +63,6 @@ debug : $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
int error_count = 0;
|
||||
|
||||
int cpp_main(int argc, char * argv[])
|
||||
int cpp_main(int /*argc*/, char * /*argv*/[])
|
||||
{
|
||||
basic_tests();
|
||||
test_simple_repeats();
|
||||
|
||||
@@ -8,7 +8,7 @@ CXX= CC $(INCLUDES) -I../../../../ -I./ $(CXXFLAGS) -L../../../../stage/lib -L..
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
SOURCES=*.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
total : r rm r/regress rm/regress rs rms rs/regress rms/regress rw rmw rw/regress rmw/regress rsw rmsw rsw/regress rmsw/regress
|
||||
echo testsing narrow character versions:
|
||||
@@ -134,5 +134,6 @@ clean:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2004
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE test.hpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Macros for test cases.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_REGEX_REGRESS_TEST_HPP
|
||||
@@ -7,6 +24,7 @@
|
||||
#include "test_regex_search.hpp"
|
||||
#include "test_regex_replace.hpp"
|
||||
#include "test_deprecated.hpp"
|
||||
#include "test_mfc.hpp"
|
||||
#include "test_locale.hpp"
|
||||
|
||||
|
||||
@@ -45,6 +63,12 @@ void test(const charT& c, const tagT& tag)
|
||||
&& (test_locale::c_locale_state() == test_locale::test_no_locale)
|
||||
&&(test_locale::cpp_locale_state() == test_locale::test_no_locale))
|
||||
test_deprecated(c, tag);
|
||||
// test MFC/ATL wrappers:
|
||||
test_info<charT>::set_typename("MFC/ATL interfaces");
|
||||
if((test_locale::win_locale_state() == test_locale::test_no_locale)
|
||||
&& (test_locale::c_locale_state() == test_locale::test_no_locale)
|
||||
&&(test_locale::cpp_locale_state() == test_locale::test_no_locale))
|
||||
test_mfc(c, tag);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -111,6 +135,12 @@ const int* make_array(int first, ...);
|
||||
TEST_REGEX_SEARCH_N(s, f, t, m, a);\
|
||||
TEST_REGEX_SEARCH_W(BOOST_JOIN(L, s), f, BOOST_JOIN(L, t), m, a)
|
||||
|
||||
#if (defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
|
||||
#define TEST_REGEX_SEARCH_L(s, f, t, m, a) TEST_REGEX_SEARCH_W(BOOST_JOIN(L, s), f, BOOST_JOIN(L, t), m, a)
|
||||
#else
|
||||
#define TEST_REGEX_SEARCH_L(s, f, t, m, a) TEST_REGEX_SEARCH(s, f, t, m, a)
|
||||
#endif
|
||||
|
||||
//
|
||||
// define macros for testing regex replaces:
|
||||
//
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_alt()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_anchors()
|
||||
{
|
||||
// line anchors:
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_forward_lookahead_asserts()
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_backrefs()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
#include "test.hpp"
|
||||
#include <boost/cregex.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4267)
|
||||
#endif
|
||||
|
||||
int get_posix_compile_options(boost::regex_constants::syntax_option_type opts)
|
||||
{
|
||||
using namespace boost;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_character_escapes()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_grep()
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,10 +11,19 @@
|
||||
|
||||
#include "test.hpp"
|
||||
#include <clocale>
|
||||
#ifndef BOOST_DISABLE_WIN32
|
||||
#if defined(BOOST_WINDOWS) && !defined(BOOST_DISABLE_WIN32)
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_STDC_NAMESPACE
|
||||
namespace std{ using ::setlocale; }
|
||||
#endif
|
||||
|
||||
test_locale::test_locale(const char* c_name, boost::uint32_t lcid)
|
||||
{
|
||||
// back up C locale and then set it's new name:
|
||||
@@ -23,29 +32,69 @@ test_locale::test_locale(const char* c_name, boost::uint32_t lcid)
|
||||
if(std::setlocale(LC_ALL, c_name))
|
||||
{
|
||||
s_c_locale = test_with_locale;
|
||||
std::cout << "Testing the global C locale: " << c_name << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
s_c_locale = no_test;
|
||||
|
||||
std::cout << "The global C locale: " << c_name << " is not available and will not be tested." << std::endl;
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
// back up the C++ locale and create the new one:
|
||||
m_old_cpp_locale = s_cpp_locale_inst;
|
||||
m_old_cpp_state = s_cpp_locale;
|
||||
try{
|
||||
s_cpp_locale_inst = std::locale(c_name);
|
||||
s_cpp_locale = test_with_locale;
|
||||
std::cout << "Testing the C++ locale: " << c_name << std::endl;
|
||||
}catch(std::runtime_error const &)
|
||||
{
|
||||
s_cpp_locale = no_test;
|
||||
std::cout << "The C++ locale: " << c_name << " is not available and will not be tested." << std::endl;
|
||||
}
|
||||
#else
|
||||
s_cpp_locale = no_test;
|
||||
#endif
|
||||
|
||||
// back up win locale and create the new one:
|
||||
m_old_win_locale = s_win_locale_inst;
|
||||
m_old_win_state = s_win_locale;
|
||||
s_win_locale_inst = lcid;
|
||||
#if defined(BOOST_WINDOWS) && !defined(BOOST_DISABLE_WIN32)
|
||||
//
|
||||
// Start by geting the printable name of the locale.
|
||||
// We use this for debugging purposes only:
|
||||
//
|
||||
boost::scoped_array<char> p;
|
||||
int r = ::GetLocaleInfoA(
|
||||
lcid, // locale identifier
|
||||
LOCALE_SCOUNTRY, // information type
|
||||
0, // information buffer
|
||||
0 // size of buffer
|
||||
);
|
||||
p.reset(new char[r+1]);
|
||||
r = ::GetLocaleInfoA(
|
||||
lcid, // locale identifier
|
||||
LOCALE_SCOUNTRY, // information type
|
||||
p.get(), // information buffer
|
||||
r+1 // size of buffer
|
||||
);
|
||||
//
|
||||
// now see if locale is installed and behave accordingly:
|
||||
//
|
||||
if(::IsValidLocale(lcid, LCID_INSTALLED))
|
||||
{
|
||||
s_win_locale = test_with_locale;
|
||||
std::cout << "Testing the Win32 locale: \"" << p.get() << "\" (0x" << std::hex << lcid << ")" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
s_win_locale = no_test;
|
||||
std::cout << "The Win32 locale: \"" << p.get() << "\" (0x" << std::hex << lcid << ") is not available and will not be tested." << std::endl;
|
||||
}
|
||||
#else
|
||||
s_win_locale = no_test;
|
||||
#endif
|
||||
}
|
||||
|
||||
test_locale::~test_locale()
|
||||
@@ -53,7 +102,9 @@ test_locale::~test_locale()
|
||||
// restore to previous state:
|
||||
std::setlocale(LC_ALL, m_old_c_locale.c_str());
|
||||
s_c_locale = m_old_c_state;
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
s_cpp_locale_inst = m_old_cpp_locale;
|
||||
#endif
|
||||
s_cpp_locale = m_old_cpp_state;
|
||||
s_win_locale_inst = m_old_win_locale;
|
||||
s_win_locale = m_old_win_state;
|
||||
@@ -62,7 +113,9 @@ test_locale::~test_locale()
|
||||
int test_locale::s_c_locale = test_no_locale;
|
||||
int test_locale::s_cpp_locale = test_no_locale;
|
||||
int test_locale::s_win_locale = test_no_locale;
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
std::locale test_locale::s_cpp_locale_inst;
|
||||
#endif
|
||||
boost::uint32_t test_locale::s_win_locale_inst = 0;
|
||||
|
||||
|
||||
@@ -71,24 +124,24 @@ void test_en_locale(const char* name, boost::uint32_t lcid)
|
||||
using namespace boost::regex_constants;
|
||||
errors_as_warnings w;
|
||||
test_locale l(name, lcid);
|
||||
TEST_REGEX_SEARCH("[[:lower:]]+", perl, "渤珀矣粤肄蓍裨跋鈿韵鴦��巐鄕��", match_default, make_array(1, 32, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:upper:]]+", perl, "神疎団兎波品北洋椀冫嘖孛慵无槿渤", match_default, make_array(1, 31, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:punct:]]+", perl, "、�ウЖ��⑭�渦慨偽係杭纂従神", match_default, make_array(0, 31, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:print:]]+", perl, "、�ウЖ��⑭�渦慨偽係杭纂従神疎団兎波品北洋椀冫嘖孛忤掣桀毳烙痰邃繙艾蜉謖邇關髓齡��巐鄕�", match_default, make_array(0, 94, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:graph:]]+", perl, "、�ウЖ��⑭�渦慨偽係杭纂従神疎団兎波品北洋椀冫嘖孛忤掣桀毳烙痰邃繙艾蜉謖邇關髓齡��巐鄕�", match_default, make_array(0, 94, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:word:]]+", perl, "請唾津毒班碧麺力佰厶壞嶷掣桀毳烙痰邃繙艾蜉謖邇關髓齡��凞'�", match_default, make_array(0, 61, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[[:lower:]]+", perl, "渤珀矣粤肄蓍裨跋鈿韵鴦��巐鄕��", match_default, make_array(1, 32, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[[:upper:]]+", perl, "神疎団兎波品北洋椀冫嘖孛慵无槿渤", match_default, make_array(1, 31, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[[:punct:]]+", perl, "、�ウЖ��⑭�渦慨偽係杭纂従神", match_default, make_array(0, 31, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[[:print:]]+", perl, "、�ウЖ��⑭�渦慨偽係杭纂従神疎団兎波品北洋椀冫嘖孛忤掣桀毳烙痰邃繙艾蜉謖邇關髓齡��巐鄕�", match_default, make_array(0, 94, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[[:graph:]]+", perl, "、�ウЖ��⑭�渦慨偽係杭纂従神疎団兎波品北洋椀冫嘖孛忤掣桀毳烙痰邃繙艾蜉謖邇關髓齡��巐鄕�", match_default, make_array(0, 94, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[[:word:]]+", perl, "請唾津毒班碧麺力佰厶壞嶷掣桀毳烙痰邃繙艾蜉謖邇關髓齡��凞'�", match_default, make_array(0, 61, -2, -2));
|
||||
// collation sensitive ranges:
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
// these tests are disabled for Borland C++: a bug in std::collate<wchar_t>
|
||||
// causes these tests to crash (pointer overrun in std::collate<wchar_t>::do_transform).
|
||||
TEST_REGEX_SEARCH("[a-z]+", perl|collate, "烙痰邃繚蓍裨跋鈿韵鴦��巐鄕", match_default, make_array(0, 28, -2, -2));
|
||||
TEST_REGEX_SEARCH("[a-z]+", perl|collate, "神疎団吐班碧麺力佰厶壞嶷掣桀", match_default, make_array(1, 28, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[a-z]+", perl|collate, "烙痰邃繚蓍裨跋鈿韵鴦��巐鄕", match_default, make_array(0, 28, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[a-z]+", perl|collate, "神疎団吐班碧麺力佰厶壞嶷掣桀", match_default, make_array(1, 28, -2, -2));
|
||||
// and equivalence classes:
|
||||
TEST_REGEX_SEARCH("[[=a=]]+", perl, "aA珀矣粤請唾津", match_default, make_array(0, 14, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[[=a=]]+", perl, "aA珀矣粤請唾津", match_default, make_array(0, 14, -2, -2));
|
||||
// case mapping:
|
||||
TEST_REGEX_SEARCH("[A-Z]+", perl|icase|collate, "烙痰邃繚蓍裨跋鈿韵鴦��巐鄕", match_default, make_array(0, 28, -2, -2));
|
||||
TEST_REGEX_SEARCH("[a-z]+", perl|icase|collate, "神疎団吐班碧麺力佰厶壞嶷掣桀", match_default, make_array(1, 28, -2, -2));
|
||||
TEST_REGEX_SEARCH("請唾津毒班碧麺力佰厶壞嶷掣桀�", perl|icase, "烙痰邃繙艾蜉謖邇關髓齡��凞'�", match_default, make_array(1, 30, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[A-Z]+", perl|icase|collate, "烙痰邃繚蓍裨跋鈿韵鴦��巐鄕", match_default, make_array(0, 28, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("[a-z]+", perl|icase|collate, "神疎団吐班碧麺力佰厶壞嶷掣桀", match_default, make_array(1, 28, -2, -2));
|
||||
TEST_REGEX_SEARCH_L("請唾津毒班碧麺力佰厶壞嶷掣桀�", perl|icase, "烙痰邃繙艾蜉謖邇關髓齡��凞'�", match_default, make_array(1, 30, -2, -2));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2004
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE test_locale.hpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Helper classes for testing locale-specific expressions.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_REGEX_REGRESS_TEST_LOCALE_HPP
|
||||
@@ -29,11 +46,12 @@ public:
|
||||
{
|
||||
return s_win_locale;
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
static std::locale cpp_locale()
|
||||
{
|
||||
return s_cpp_locale_inst;
|
||||
}
|
||||
#endif
|
||||
static boost::uint32_t win_locale()
|
||||
{
|
||||
return s_win_locale_inst;
|
||||
@@ -45,13 +63,17 @@ private:
|
||||
static int s_cpp_locale;
|
||||
static int s_win_locale;
|
||||
// current locales:
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
static std::locale s_cpp_locale_inst;
|
||||
#endif
|
||||
static boost::uint32_t s_win_locale_inst;
|
||||
|
||||
// backed up versions of the previous locales and their action state:
|
||||
std::string m_old_c_locale;
|
||||
int m_old_c_state;
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
std::locale m_old_cpp_locale;
|
||||
#endif
|
||||
int m_old_cpp_state;
|
||||
boost::uint32_t m_old_win_locale;
|
||||
int m_old_win_state;
|
||||
|
||||
@@ -0,0 +1,555 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2004
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE test_mfc.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Test code for MFC/ATL strings with Boost.Regex.
|
||||
*/
|
||||
|
||||
//
|
||||
// We can only build this if we have ATL support:
|
||||
//
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if (defined(BOOST_MSVC) || defined(__ICL)) && (_MSC_VER >= 1300)
|
||||
# define TEST_MFC
|
||||
#endif
|
||||
|
||||
#ifdef TEST_MFC
|
||||
|
||||
#include <boost/regex/mfc.hpp>
|
||||
#include "test.hpp"
|
||||
#include "atlstr.h"
|
||||
|
||||
#pragma warning(disable:4267)
|
||||
|
||||
void test_mfc(const char&, const test_regex_search_tag&)
|
||||
{
|
||||
const std::string& ss = test_info<char>::search_text();
|
||||
const std::string& ss2 = test_info<char>::expression();
|
||||
CAtlStringA s(ss.c_str(), ss.size());
|
||||
CAtlStringA s2(ss2.c_str(), ss2.size());
|
||||
boost::regex_constants::match_flag_type opts = test_info<char>::match_options();
|
||||
const int* answer_table = test_info<char>::answer_table();
|
||||
boost::regex r = boost::make_regex(s2, test_info<char>::syntax_options());
|
||||
boost::cmatch what;
|
||||
if(boost::regex_search(
|
||||
s,
|
||||
what,
|
||||
r,
|
||||
opts))
|
||||
{
|
||||
test_result(what, s.GetString(), answer_table);
|
||||
}
|
||||
else if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", char);
|
||||
}
|
||||
//
|
||||
// regex_match tests:
|
||||
//
|
||||
if(answer_table[0] < 0)
|
||||
{
|
||||
if(boost::regex_match(s, r, opts))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("boost::regex_match found a match when it should not have done so.", char);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if((answer_table[0] > 0) && boost::regex_match(s, r, opts))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("boost::regex_match found a match when it should not have done so.", char);
|
||||
}
|
||||
else if((answer_table[0] == 0) && (answer_table[1] == static_cast<int>(ss.size())))
|
||||
{
|
||||
if(boost::regex_match(
|
||||
s,
|
||||
what,
|
||||
r,
|
||||
opts))
|
||||
{
|
||||
test_result(what, s.GetString(), answer_table);
|
||||
if(!boost::regex_match(s, r, opts))
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", char);
|
||||
}
|
||||
}
|
||||
else if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", char);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// test regex_iterator:
|
||||
//
|
||||
boost::cregex_iterator start(boost::make_regex_iterator(s, r, opts)), end;
|
||||
boost::cregex_iterator copy(start);
|
||||
while(start != end)
|
||||
{
|
||||
if(start != copy)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator != comparison.", char);
|
||||
}
|
||||
if(!(start == copy))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", char);
|
||||
}
|
||||
test_result(*start, s.GetString(), answer_table);
|
||||
++start;
|
||||
++copy;
|
||||
// move on the answer table to next set of answers;
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", char);
|
||||
}
|
||||
//
|
||||
// test regex_token_iterator:
|
||||
//
|
||||
typedef boost::regex_token_iterator<const char*> token_iterator;
|
||||
answer_table = test_info<char>::answer_table();
|
||||
//
|
||||
// we start by testing sub-expression 0:
|
||||
//
|
||||
token_iterator tstart(boost::make_regex_token_iterator(s, r, 0, opts)), tend;
|
||||
token_iterator tcopy(tstart);
|
||||
while(tstart != tend)
|
||||
{
|
||||
if(tstart != tcopy)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator != comparison.", char);
|
||||
}
|
||||
if(!(tstart == tcopy))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", char);
|
||||
}
|
||||
test_sub_match(*tstart, s.GetString(), answer_table, 0);
|
||||
++tstart;
|
||||
++tcopy;
|
||||
// move on the answer table to next set of answers;
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", char);
|
||||
}
|
||||
//
|
||||
// and now field spitting:
|
||||
//
|
||||
token_iterator tstart2(boost::make_regex_token_iterator(s, r, -1, opts)), tend2;
|
||||
token_iterator tcopy2(tstart2);
|
||||
int last_end2 = 0;
|
||||
answer_table = test_info<char>::answer_table();
|
||||
while(tstart2 != tend2)
|
||||
{
|
||||
if(tstart2 != tcopy2)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator != comparison.", char);
|
||||
}
|
||||
if(!(tstart2 == tcopy2))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", char);
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4244)
|
||||
#endif
|
||||
if(std::distance(s.GetString(), tstart2->first) != last_end2)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR(
|
||||
"Error in location of start of field split, found: "
|
||||
<< std::distance(s.GetString(), tstart2->first)
|
||||
<< ", expected: "
|
||||
<< last_end2
|
||||
<< ".", char);
|
||||
}
|
||||
int expected_end = static_cast<int>(answer_table[0] < 0 ? s.GetLength() : answer_table[0]);
|
||||
if(std::distance(s.GetString(), tstart2->second) != expected_end)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR(
|
||||
"Error in location of end2 of field split, found: "
|
||||
<< std::distance(s.GetString(), tstart2->second)
|
||||
<< ", expected: "
|
||||
<< expected_end
|
||||
<< ".", char);
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
last_end2 = answer_table[1];
|
||||
++tstart2;
|
||||
++tcopy2;
|
||||
// move on the answer table to next set of answers;
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", char);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void test_mfc(const wchar_t&, const test_regex_search_tag&)
|
||||
{
|
||||
const std::wstring& ss = test_info<wchar_t>::search_text();
|
||||
const std::wstring& ss2 = test_info<wchar_t>::expression();
|
||||
CAtlStringW s(ss.c_str(), ss.size());
|
||||
CAtlStringW s2(ss2.c_str(), ss2.size());
|
||||
boost::regex_constants::match_flag_type opts = test_info<wchar_t>::match_options();
|
||||
const int* answer_table = test_info<wchar_t>::answer_table();
|
||||
boost::wregex r = boost::make_regex(s2, test_info<wchar_t>::syntax_options());
|
||||
boost::wcmatch what;
|
||||
if(boost::regex_search(
|
||||
s,
|
||||
what,
|
||||
r,
|
||||
opts))
|
||||
{
|
||||
test_result(what, s.GetString(), answer_table);
|
||||
}
|
||||
else if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", wchar_t);
|
||||
}
|
||||
//
|
||||
// regex_match tests:
|
||||
//
|
||||
if(answer_table[0] < 0)
|
||||
{
|
||||
if(boost::regex_match(s, r, opts))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("boost::regex_match found a match when it should not have done so.", wchar_t);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if((answer_table[0] > 0) && boost::regex_match(s, r, opts))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("boost::regex_match found a match when it should not have done so.", wchar_t);
|
||||
}
|
||||
else if((answer_table[0] == 0) && (answer_table[1] == static_cast<int>(ss.size())))
|
||||
{
|
||||
if(boost::regex_match(
|
||||
s,
|
||||
what,
|
||||
r,
|
||||
opts))
|
||||
{
|
||||
test_result(what, s.GetString(), answer_table);
|
||||
if(!boost::regex_match(s, r, opts))
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", wchar_t);
|
||||
}
|
||||
}
|
||||
else if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", wchar_t);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// test regex_iterator:
|
||||
//
|
||||
boost::wcregex_iterator start(boost::make_regex_iterator(s, r, opts)), end;
|
||||
boost::wcregex_iterator copy(start);
|
||||
while(start != end)
|
||||
{
|
||||
if(start != copy)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator != comparison.", wchar_t);
|
||||
}
|
||||
if(!(start == copy))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", wchar_t);
|
||||
}
|
||||
test_result(*start, s.GetString(), answer_table);
|
||||
++start;
|
||||
++copy;
|
||||
// move on the answer table to next set of answers;
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", wchar_t);
|
||||
}
|
||||
//
|
||||
// test regex_token_iterator:
|
||||
//
|
||||
typedef boost::regex_token_iterator<const wchar_t*> token_iterator;
|
||||
answer_table = test_info<wchar_t>::answer_table();
|
||||
//
|
||||
// we start by testing sub-expression 0:
|
||||
//
|
||||
token_iterator tstart(boost::make_regex_token_iterator(s, r, 0, opts)), tend;
|
||||
token_iterator tcopy(tstart);
|
||||
while(tstart != tend)
|
||||
{
|
||||
if(tstart != tcopy)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator != comparison.", wchar_t);
|
||||
}
|
||||
if(!(tstart == tcopy))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", wchar_t);
|
||||
}
|
||||
test_sub_match(*tstart, s.GetString(), answer_table, 0);
|
||||
++tstart;
|
||||
++tcopy;
|
||||
// move on the answer table to next set of answers;
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", wchar_t);
|
||||
}
|
||||
//
|
||||
// and now field spitting:
|
||||
//
|
||||
token_iterator tstart2(boost::make_regex_token_iterator(s, r, -1, opts)), tend2;
|
||||
token_iterator tcopy2(tstart2);
|
||||
int last_end2 = 0;
|
||||
answer_table = test_info<wchar_t>::answer_table();
|
||||
while(tstart2 != tend2)
|
||||
{
|
||||
if(tstart2 != tcopy2)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator != comparison.", wchar_t);
|
||||
}
|
||||
if(!(tstart2 == tcopy2))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", wchar_t);
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4244)
|
||||
#endif
|
||||
if(std::distance(s.GetString(), tstart2->first) != last_end2)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR(
|
||||
"Error in location of start of field split, found: "
|
||||
<< std::distance(s.GetString(), tstart2->first)
|
||||
<< ", expected: "
|
||||
<< last_end2
|
||||
<< ".", wchar_t);
|
||||
}
|
||||
int expected_end = static_cast<int>(answer_table[0] < 0 ? s.GetLength() : answer_table[0]);
|
||||
if(std::distance(s.GetString(), tstart2->second) != expected_end)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR(
|
||||
"Error in location of end2 of field split, found: "
|
||||
<< std::distance(s.GetString(), tstart2->second)
|
||||
<< ", expected: "
|
||||
<< expected_end
|
||||
<< ".", wchar_t);
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
last_end2 = answer_table[1];
|
||||
++tstart2;
|
||||
++tcopy2;
|
||||
// move on the answer table to next set of answers;
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", wchar_t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void test_mfc(const char&, const test_invalid_regex_tag&)
|
||||
{
|
||||
std::string ss = test_info<char>::expression();
|
||||
CAtlStringA s(ss.c_str(), ss.size());
|
||||
bool have_catch = false;
|
||||
try{
|
||||
boost::regex e = boost::make_regex(s, test_info<char>::syntax_options());
|
||||
if(e.error_code())
|
||||
have_catch = true;
|
||||
}
|
||||
catch(const boost::bad_expression&)
|
||||
{
|
||||
have_catch = true;
|
||||
}
|
||||
catch(const std::runtime_error& r)
|
||||
{
|
||||
have_catch = true;
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::runtime_error instead: " << r.what(), char);
|
||||
}
|
||||
catch(const std::exception& r)
|
||||
{
|
||||
have_catch = true;
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::exception instead: " << r.what(), char);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
have_catch = true;
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but got an exception of unknown type instead", char);
|
||||
}
|
||||
if(!have_catch)
|
||||
{
|
||||
// oops expected exception was not thrown:
|
||||
BOOST_REGEX_TEST_ERROR("Expected an exception, but didn't find one.", char);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void test_mfc(const wchar_t&, const test_invalid_regex_tag&)
|
||||
{
|
||||
std::wstring ss = test_info<wchar_t>::expression();
|
||||
CAtlStringW s(ss.c_str(), ss.size());
|
||||
bool have_catch = false;
|
||||
try{
|
||||
boost::wregex e = boost::make_regex(s, test_info<wchar_t>::syntax_options());
|
||||
if(e.error_code())
|
||||
have_catch = true;
|
||||
}
|
||||
catch(const boost::bad_expression&)
|
||||
{
|
||||
have_catch = true;
|
||||
}
|
||||
catch(const std::runtime_error& r)
|
||||
{
|
||||
have_catch = true;
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::runtime_error instead: " << r.what(), wchar_t);
|
||||
}
|
||||
catch(const std::exception& r)
|
||||
{
|
||||
have_catch = true;
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::exception instead: " << r.what(), wchar_t);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
have_catch = true;
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but got an exception of unknown type instead", wchar_t);
|
||||
}
|
||||
if(!have_catch)
|
||||
{
|
||||
// oops expected exception was not thrown:
|
||||
BOOST_REGEX_TEST_ERROR("Expected an exception, but didn't find one.", wchar_t);
|
||||
}
|
||||
}
|
||||
|
||||
void test_mfc(const char&, const test_regex_replace_tag&)
|
||||
{
|
||||
const CStringA expression(test_info<char>::expression().c_str(), test_info<char>::expression().size());
|
||||
boost::regex_constants::syntax_option_type syntax_options = test_info<char>::syntax_options();
|
||||
try{
|
||||
boost::regex r = boost::make_regex(expression, syntax_options);
|
||||
if(r.status())
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Expression did not compile when it should have done, error code = " << r.status(), char);
|
||||
}
|
||||
const CStringA search_text(test_info<char>::search_text().c_str(), test_info<char>::search_text().size());
|
||||
boost::regex_constants::match_flag_type opts = test_info<char>::match_options();
|
||||
const CStringA format_string(test_info<char>::format_string().c_str(), test_info<char>::format_string().size());
|
||||
const CStringA result_string(test_info<char>::result_string().c_str(), test_info<char>::result_string().size());
|
||||
|
||||
CStringA result = boost::regex_replace(search_text, r, format_string, opts);
|
||||
if(result != result_string)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("regex_replace generated an incorrect string result", char);
|
||||
}
|
||||
}
|
||||
catch(const boost::bad_expression& e)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Expression did not compile when it should have done: " << e.what(), char);
|
||||
}
|
||||
catch(const std::runtime_error& r)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::runtime_error: " << r.what(), char);
|
||||
}
|
||||
catch(const std::exception& r)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::exception: " << r.what(), char);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected exception of unknown type", char);
|
||||
}
|
||||
}
|
||||
|
||||
void test_mfc(const wchar_t&, const test_regex_replace_tag&)
|
||||
{
|
||||
const CStringW expression(test_info<wchar_t>::expression().c_str(), test_info<wchar_t>::expression().size());
|
||||
boost::regex_constants::syntax_option_type syntax_options = test_info<wchar_t>::syntax_options();
|
||||
try{
|
||||
boost::wregex r = boost::make_regex(expression, syntax_options);
|
||||
if(r.status())
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Expression did not compile when it should have done, error code = " << r.status(), wchar_t);
|
||||
}
|
||||
const CStringW search_text(test_info<wchar_t>::search_text().c_str(), test_info<wchar_t>::search_text().size());
|
||||
boost::regex_constants::match_flag_type opts = test_info<wchar_t>::match_options();
|
||||
const CStringW format_string(test_info<wchar_t>::format_string().c_str(), test_info<wchar_t>::format_string().size());
|
||||
const CStringW result_string(test_info<wchar_t>::result_string().c_str(), test_info<wchar_t>::result_string().size());
|
||||
|
||||
CStringW result = boost::regex_replace(search_text, r, format_string, opts);
|
||||
if(result != result_string)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("regex_replace generated an incorrect string result", wchar_t);
|
||||
}
|
||||
}
|
||||
catch(const boost::bad_expression& e)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Expression did not compile when it should have done: " << e.what(), wchar_t);
|
||||
}
|
||||
catch(const std::runtime_error& r)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::runtime_error: " << r.what(), wchar_t);
|
||||
}
|
||||
catch(const std::exception& r)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::exception: " << r.what(), wchar_t);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected exception of unknown type", wchar_t);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
void test_mfc(const char&, const test_regex_search_tag&){}
|
||||
void test_mfc(const wchar_t&, const test_regex_search_tag&){}
|
||||
void test_mfc(const char&, const test_invalid_regex_tag&){}
|
||||
void test_mfc(const wchar_t&, const test_invalid_regex_tag&){}
|
||||
void test_mfc(const char&, const test_regex_replace_tag&){}
|
||||
void test_mfc(const wchar_t&, const test_regex_replace_tag&){}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2004
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE test_mfc.hpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: MFC/ATL test handlers.
|
||||
*/
|
||||
|
||||
#ifndef TEST_MFC_HPP
|
||||
#define TEST_MFC_HPP
|
||||
|
||||
template <class charT, class Tag>
|
||||
void test_mfc(const charT&, const Tag&)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void test_mfc(const char&, const test_regex_search_tag&);
|
||||
void test_mfc(const wchar_t&, const test_regex_search_tag&);
|
||||
void test_mfc(const char&, const test_invalid_regex_tag&);
|
||||
void test_mfc(const wchar_t&, const test_invalid_regex_tag&);
|
||||
void test_mfc(const char&, const test_regex_replace_tag&);
|
||||
void test_mfc(const wchar_t&, const test_regex_replace_tag&);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_non_greedy_repeats()
|
||||
{
|
||||
//
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_independent_subs()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
|
||||
@@ -110,6 +110,7 @@ void test_regex_iterator(boost::basic_regex<charT, traits>& r)
|
||||
const int* answer_table = test_info<charT>::answer_table();
|
||||
test_iterator start(search_text.begin(), search_text.end(), r, opts), end;
|
||||
test_iterator copy(start);
|
||||
const_iterator last_end = search_text.begin();
|
||||
while(start != end)
|
||||
{
|
||||
if(start != copy)
|
||||
@@ -121,10 +122,129 @@ void test_regex_iterator(boost::basic_regex<charT, traits>& r)
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", charT);
|
||||
}
|
||||
test_result(*start, search_text.begin(), answer_table);
|
||||
// test $` and $' :
|
||||
if(start->prefix().first != last_end)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Incorrect position for start of $`", charT);
|
||||
}
|
||||
if(start->prefix().second != (*start)[0].first)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Incorrect position for end of $`", charT);
|
||||
}
|
||||
if(start->prefix().matched != (start->prefix().first != start->prefix().second))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Incorrect position for matched member of $`", charT);
|
||||
}
|
||||
if(start->suffix().first != (*start)[0].second)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Incorrect position for start of $'", charT);
|
||||
}
|
||||
if(start->suffix().second != search_text.end())
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Incorrect position for end of $'", charT);
|
||||
}
|
||||
if(start->suffix().matched != (start->suffix().first != start->suffix().second))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Incorrect position for matched member of $'", charT);
|
||||
}
|
||||
last_end = (*start)[0].second;
|
||||
++start;
|
||||
++copy;
|
||||
// move on the answer table to next set of answers;
|
||||
while(*answer_table++ != -2){}
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", charT);
|
||||
}
|
||||
}
|
||||
|
||||
template<class charT, class traits>
|
||||
void test_regex_token_iterator(boost::basic_regex<charT, traits>& r)
|
||||
{
|
||||
typedef typename std::basic_string<charT>::const_iterator const_iterator;
|
||||
typedef boost::regex_token_iterator<const_iterator, charT, traits> test_iterator;
|
||||
const std::basic_string<charT>& search_text = test_info<charT>::search_text();
|
||||
boost::regex_constants::match_flag_type opts = test_info<charT>::match_options();
|
||||
const int* answer_table = test_info<charT>::answer_table();
|
||||
//
|
||||
// we start by testing sub-expression 0:
|
||||
//
|
||||
test_iterator start(search_text.begin(), search_text.end(), r, 0, opts), end;
|
||||
test_iterator copy(start);
|
||||
while(start != end)
|
||||
{
|
||||
if(start != copy)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator != comparison.", charT);
|
||||
}
|
||||
if(!(start == copy))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", charT);
|
||||
}
|
||||
test_sub_match(*start, search_text.begin(), answer_table, 0);
|
||||
++start;
|
||||
++copy;
|
||||
// move on the answer table to next set of answers;
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
// we should have had a match but didn't:
|
||||
BOOST_REGEX_TEST_ERROR("Expected match was not found.", charT);
|
||||
}
|
||||
//
|
||||
// and now field spitting:
|
||||
//
|
||||
test_iterator start2(search_text.begin(), search_text.end(), r, -1, opts), end2;
|
||||
test_iterator copy2(start2);
|
||||
int last_end2 = 0;
|
||||
answer_table = test_info<charT>::answer_table();
|
||||
while(start2 != end2)
|
||||
{
|
||||
if(start2 != copy2)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator != comparison.", charT);
|
||||
}
|
||||
if(!(start2 == copy2))
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Failed iterator == comparison.", charT);
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4244)
|
||||
#endif
|
||||
if(std::distance(search_text.begin(), start2->first) != last_end2)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR(
|
||||
"Error in location of start of field split, found: "
|
||||
<< std::distance(search_text.begin(), start2->first)
|
||||
<< ", expected: "
|
||||
<< last_end2
|
||||
<< ".", charT);
|
||||
}
|
||||
int expected_end = static_cast<int>(answer_table[0] < 0 ? search_text.size() : answer_table[0]);
|
||||
if(std::distance(search_text.begin(), start2->second) != expected_end)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR(
|
||||
"Error in location of end2 of field split, found: "
|
||||
<< std::distance(search_text.begin(), start2->second)
|
||||
<< ", expected: "
|
||||
<< expected_end
|
||||
<< ".", charT);
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
last_end2 = answer_table[1];
|
||||
++start2;
|
||||
++copy2;
|
||||
// move on the answer table to next set of answers;
|
||||
if(*answer_table != -2)
|
||||
while(*answer_table++ != -2){}
|
||||
}
|
||||
if(answer_table[0] >= 0)
|
||||
{
|
||||
@@ -145,7 +265,8 @@ struct grep_test_predicate
|
||||
{
|
||||
test_result(what, m_base, m_table);
|
||||
// move on the answer table to next set of answers;
|
||||
while(*m_table++ != -2){}
|
||||
if(*m_table != -2)
|
||||
while(*m_table++ != -2){}
|
||||
return true;
|
||||
}
|
||||
private:
|
||||
@@ -218,6 +339,7 @@ void test(boost::basic_regex<charT, traits>& r, const test_regex_search_tag&)
|
||||
}
|
||||
test_simple_search(r);
|
||||
test_regex_iterator(r);
|
||||
test_regex_token_iterator(r);
|
||||
test_regex_grep(r);
|
||||
test_regex_match(r);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_replace()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_sets()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
@@ -117,6 +121,19 @@ void test_sets()
|
||||
TEST_REGEX_SEARCH("\\W", perl, "`", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("\\W", perl, "[", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("\\W", perl, "@", match_default, make_array(0, 1, -2, -2));
|
||||
|
||||
TEST_REGEX_SEARCH("[[:lower:]]", perl|icase, "A", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:upper:]]", perl|icase, "A", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:alpha:]]", perl|icase, "A", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:alnum:]]", perl|icase, "A", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:lower:]]", perl|icase, "a", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:upper:]]", perl|icase, "a", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:alpha:]]", perl|icase, "a", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:alnum:]]", perl|icase, "a", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:lower:][:upper:]]", perl, "A", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:lower:][:upper:]]", perl, "a", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:lower:][:alpha:]]", perl, "A", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("[[:lower:][:alpha:]]", perl, "a", match_default, make_array(0, 1, -2, -2));
|
||||
}
|
||||
|
||||
void test_sets2()
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_simple_repeats()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4127)
|
||||
#endif
|
||||
|
||||
void test_tricky_cases()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
|
||||
@@ -24,7 +24,7 @@ XLFLAGS=
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
SOURCES=*.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
!IF "$(MSVCDIR)" == ""
|
||||
!ERROR Variable MSVCDIR not set.
|
||||
@@ -219,3 +219,4 @@ r6mdd.exe : $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ XLFLAGS=
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
SOURCES=*.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
CFLAGS= $(INCLUDES) /O2 /GB /GF /Gy -GX -GR -I..\..\..\..\ $(CXXFLAGS)
|
||||
|
||||
@@ -227,5 +227,6 @@ r6lmd.exe : $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ XLFLAGS=
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
SOURCES=*.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
CFLAGS= $(INCLUDES) /O2 /GB /GF /Gy -GX -GR -I..\..\..\..\ $(CXXFLAGS) /DBOOST_LIB_DIAGNOSTIC=1 /Zc:wchar_t
|
||||
|
||||
@@ -229,5 +229,6 @@ r6lmd.exe : $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ XLFLAGS=
|
||||
#
|
||||
# sources to compile for each test:
|
||||
#
|
||||
SOURCES=basic_tests.cpp main.cpp test_deprecated.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
SOURCES=*.cpp ../../../test/src/cpp_main.cpp ../../../test/src/execution_monitor.cpp
|
||||
|
||||
CFLAGS= $(INCLUDES) /GB /GF /Gy -GX -GR -I..\..\..\..\ $(CXXFLAGS) /DBOOST_LIB_DIAGNOSTIC=1 /Zc:wchar_t
|
||||
|
||||
@@ -240,5 +240,6 @@ r6lmd.exe : $(SOURCES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user