Added the regression test driver and the first test case
git-svn-id: http://svn.code.sf.net/p/utfcpp/code@10 a809a056-fc17-0410-9590-b4f493f8b08e
This commit is contained in:
parent
7879ce9b52
commit
fa0ef27df2
2 changed files with 33 additions and 0 deletions
13
test_drivers/regression_tests/r1_0Beta1/invalidutf8.h
Normal file
13
test_drivers/regression_tests/r1_0Beta1/invalidutf8.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include "../../../source/utf8.h"
|
||||
using namespace utf8;
|
||||
|
||||
/// [ 1524459 ] utf8::is_valid does not report some illegal code positions
|
||||
void id_1524459()
|
||||
{
|
||||
|
||||
unsigned char ud800[] = {0xed, 0xa0, 0x80};
|
||||
check (!is_valid(ud800, ud800 + 3));
|
||||
|
||||
|
||||
|
||||
}
|
20
test_drivers/regression_tests/reg_tests_driver.cpp
Normal file
20
test_drivers/regression_tests/reg_tests_driver.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
inline void check_impl (bool condition, const char* file, int line)
|
||||
{
|
||||
if (!condition) {
|
||||
cout << "Check Failed! File: " << file << " Line: " << line << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
#define check(c) check_impl(c, __FILE__, __LINE__);
|
||||
|
||||
#include "r1_0Beta1/invalidutf8.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
//r1_0Beta1/invalidutf8.h
|
||||
id_1524459();
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue