Updated makefiles to reflect the new source structure

git-svn-id: http://svn.code.sf.net/p/utfcpp/code@73 a809a056-fc17-0410-9590-b4f493f8b08e
This commit is contained in:
ntrifunovic 2006-12-18 01:50:44 +00:00
parent e022e54c64
commit 83b6f918a9
7 changed files with 29 additions and 5 deletions

View file

@ -1,5 +1,5 @@
CC = g++
CFLAGS = -g -Wall -pedantic
negativetest: negative.cpp ../../source/utf8.h
negativetest: negative.cpp ../../source/utf8.h ../../source/utf8/core.h ../../source/utf8/checked.h ../../source/utf8/unchecked.h
$(CC) $(CFLAGS) negative.cpp -onegative

View file

@ -1,5 +1,5 @@
CC = g++
CFLAGS = -O2
iconvtest: iconvtest.cpp ../../source/utf8.h timer.h
iconvtest: iconvtest.cpp ../../source/utf8.h timer.h ../../source/utf8/core.h ../../source/utf8/checked.h ../../source/utf8/unchecked.h
$(CC) $(CFLAGS) iconvtest.cpp -oiconvtest

View file

@ -2,5 +2,5 @@ CC = g++
CFLAGS = -g -Wall -pedantic
REG_FILES = r1_0Beta1/*h r1_0Beta2/*.h
regressiontest: reg_tests_driver.cpp ../../source/utf8.h $(REG_FILES)
regressiontest: reg_tests_driver.cpp ../../source/utf8.h ../../source/utf8/core.h ../../source/utf8/checked.h ../../source/utf8/unchecked.h $(REG_FILES)
$(CC) $(CFLAGS) reg_tests_driver.cpp -o regressiontest

View file

@ -1,5 +1,5 @@
CC = g++
CFLAGS = -g -Wall
smoketest: test.cpp ../../source/utf8.h
smoketest: test.cpp ../../source/utf8.h ../../source/utf8/core.h ../../source/utf8/checked.h ../../source/utf8/unchecked.h
$(CC) $(CFLAGS) test.cpp -osmoketest

View file

@ -156,6 +156,7 @@ int main()
assert (*(++it) == 0x65e5);
assert ((*it++) == 0x65e5);
assert (*it == 0x0448);
assert (it != it2);
utf8::iterator<char*> endit (threechars + 9, threechars, threechars + 9);
assert (++it == endit);
assert (*(--it) == 0x0448);
@ -265,6 +266,7 @@ int main()
assert (*un_it == 0x10346);
assert (*(++un_it) == 0x65e5);
assert ((*un_it++) == 0x65e5);
assert (un_it != un_it2);
assert (*un_it == 0x0448);
utf8::unchecked::iterator<char*> un_endit (threechars + 9);
assert (++un_it == un_endit);

View file

@ -1,5 +1,5 @@
CC = g++
CFLAGS = -g -Wall -pedantic
utf8readertest: utf8reader.cpp ../../source/utf8.h
utf8readertest: utf8reader.cpp ../../source/utf8.h ../../source/utf8/core.h ../../source/utf8/checked.h ../../source/utf8/unchecked.h
$(CC) $(CFLAGS) utf8reader.cpp -o utf8reader

View file

@ -80,6 +80,18 @@ int main(int argc, char** argv)
if (char_count != 0)
cout << "Line " << line_count << ": Error in iterating with previous - wrong number of characters" << '\n';
// Try utf8::iterator
utf8::iterator<string::iterator> u8it(line_start, line_start, line_end);
if (!utf32_line.empty() && *u8it != utf32_line.at(0))
cout << "Line " << line_count << ": Error in utf::iterator * operator" << '\n';
if (std::distance(u8it, utf8::iterator<string::iterator>(line_end, line_start, line_end)) != static_cast<int>(utf32_line.size()))
cout << "Line " << line_count << ": Error in using utf::iterator with std::distance - wrong number of characters" << '\n';
std::advance(u8it, utf32_line.size());
if (u8it != utf8::iterator<string::iterator>(line_end, line_start, line_end))
cout << "Line " << line_count << ": Error in using utf::iterator with std::advance" << '\n';
//======================== Now, the unchecked versions ======================
// Convert it to utf-16 and compare to the checked version
vector<unsigned short> utf16_line_unchecked;
@ -130,5 +142,15 @@ int main(int argc, char** argv)
if (char_count != 0)
cout << "Line " << line_count << ": Error in iterating with unchecked::previous - wrong number of characters" << '\n';
// Try utf8::unchecked::iterator
utf8::unchecked::iterator<string::iterator> un_u8it(line_start);
if (!utf32_line.empty() && *un_u8it != utf32_line.at(0))
cout << "Line " << line_count << ": Error in utf::unchecked::iterator * operator" << '\n';
if (std::distance(un_u8it, utf8::unchecked::iterator<string::iterator>(line_end)) != static_cast<int>(utf32_line.size()))
cout << "Line " << line_count << ": Error in using utf::unchecked::iterator with std::distance - wrong number of characters" << '\n';
std::advance(un_u8it, utf32_line.size());
if (un_u8it != utf8::unchecked::iterator<string::iterator>(line_end))
cout << "Line " << line_count << ": Error in using utf::unchecked::iterator with std::advance" << '\n';
}
}