forked from boostorg/regex
Change asserts to tests.
[SVN r37080]
This commit is contained in:
@ -135,3 +135,4 @@ test-suite regex
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/regex.h>
|
#include <boost/regex.h>
|
||||||
|
#include <boost/detail/lightweight_test.hpp>
|
||||||
|
|
||||||
const char* expression = "^";
|
const char* expression = "^";
|
||||||
const char* text = "\n ";
|
const char* text = "\n ";
|
||||||
@ -42,7 +43,7 @@ int main()
|
|||||||
printf(buf);
|
printf(buf);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
BOOST_ASSERT(re.re_nsub == 0);
|
BOOST_TEST(re.re_nsub == 0);
|
||||||
matches[0].rm_so = 0;
|
matches[0].rm_so = 0;
|
||||||
matches[0].rm_eo = strlen(text);
|
matches[0].rm_eo = strlen(text);
|
||||||
result = regexec(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
|
result = regexec(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
|
||||||
@ -54,10 +55,10 @@ int main()
|
|||||||
regfree(&re);
|
regfree(&re);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
BOOST_ASSERT(matches[0].rm_so == matches[0].rm_eo == 1);
|
BOOST_TEST(matches[0].rm_so == matches[0].rm_eo == 1);
|
||||||
regfree(&re);
|
regfree(&re);
|
||||||
printf("no errors found\n");
|
printf("no errors found\n");
|
||||||
return 0;
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user