From 1e17f800fe4ddc857132d29b45684ff7d5b9fb5b Mon Sep 17 00:00:00 2001 From: ntrifunovic Date: Wed, 26 Jul 2006 17:39:56 +0000 Subject: [PATCH] Changed unchecked::next to match utf8::match. The functionality should remain the same. git-svn-id: http://svn.code.sf.net/p/utfcpp/code@24 a809a056-fc17-0410-9590-b4f493f8b08e --- test_drivers/smoke_test/test.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test_drivers/smoke_test/test.cpp b/test_drivers/smoke_test/test.cpp index 6a62b00..0afcc25 100644 --- a/test_drivers/smoke_test/test.cpp +++ b/test_drivers/smoke_test/test.cpp @@ -27,7 +27,21 @@ int main() assert (cp == 0x65e5); assert (w == twochars + 3); + unsigned char threechars[] = {0xf0, 0x90, 0x8d, 0x86, 0xe6, 0x97, 0xA5, 0xd1, 0x88, 0x0}; + w = threechars; + cp = next(w, threechars + 9); + assert (cp == 0x10346); + assert (w == threechars + 4); + cp = next(w, threechars + 9); + assert (cp == 0x65e5); + assert (w == threechars + 7); + cp = next(w, threechars + 9); + assert (cp == 0x0448); + assert (w == threechars + 9); + + //previous + w = twochars + 3; cp = previous (w, twochars - 1); assert (cp == 0x65e5); assert (w == twochars); @@ -104,6 +118,20 @@ int main() assert (cp == 0x65e5); assert (w == twochars + 3); + w = threechars; + cp = unchecked::next(w); + assert (cp == 0x10346); + assert (w == threechars + 4); + cp = unchecked::next(w); + assert (cp == 0x65e5); + assert (w == threechars + 7); + cp = unchecked::next(w); + assert (cp == 0x0448); + assert (w == threechars + 9); + + + //previous + w = twochars + 3; //previous cp = unchecked::previous (w); assert (cp == 0x65e5);