17 #include "my_config.h"
18 #include <gtest/gtest.h>
29 namespace my_regex_unittest {
38 memset(&re, 0,
sizeof(re));
40 static void TearDownTestCase()
58 {
"a", MY_REG_BASIC,
"a" },
59 {
"abc", MY_REG_BASIC,
"abc" },
60 {
"abc|de", MY_REG_EXTENDED,
"abc" },
61 {
"a|b|c", MY_REG_EXTENDED,
"abc" },
65 TEST_F(RegexTest, BasicTest)
67 for (
int ix=0; basic_data[ix].pattern; ++ix)
69 EXPECT_EQ(0, my_regcomp(&re,
70 basic_data[ix].pattern,
71 basic_data[ix].cflags,
74 int err= my_regexec(&re, basic_data[ix].input, NSUBS, subs, 0);
76 <<
"my_regexec returned " << err
77 <<
" for pattern '" << basic_data[ix].pattern <<
"'"
78 <<
" with input '" << basic_data[ix].input <<
"'";