diff options
-rw-r--r-- | test/unit/Makefile.am | 6 | ||||
-rw-r--r-- | test/unit/unicode_test.cc | 25 |
2 files changed, 25 insertions, 6 deletions
diff --git a/test/unit/Makefile.am b/test/unit/Makefile.am index 41bc56df..07a91b37 100644 --- a/test/unit/Makefile.am +++ b/test/unit/Makefile.am @@ -14,13 +14,13 @@ TESTS = \ identity \ liang \ notsosimplevector \ - shapes + shapes \ + unicode_test # Some test are broken, so only build them check_PROGRAMS = $(TESTS) \ cookies \ - trie \ - unicode_test + trie containers_SOURCES = containers.cc notsosimplevector_SOURCES = notsosimplevector.cc diff --git a/test/unit/unicode_test.cc b/test/unit/unicode_test.cc index 7c079305..0824cdd0 100644 --- a/test/unit/unicode_test.cc +++ b/test/unit/unicode_test.cc @@ -1,7 +1,27 @@ +/* + * File: unicode_test.cc + * + * Copyright 2012 Sebastian Geerken <sgeerken@dillo.org> + * Copyright 2023 Rodrigo Arias Mallo <rodarima@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + #include <string.h> #include <stdio.h> #include <FL/fl_utf8.h> -#include "../lout/unicode.hh" +#include "lout/unicode.hh" using namespace lout::unicode; @@ -30,8 +50,7 @@ int main (int argc, char *argv[]) decodeUtf8(s, t2len - (s - t2))); puts ("===== Fltk, not 0-terminated ====="); - for (const char *s = t2; *s; - s - t2 < t2len && (s = fl_utf8fwd (s + 1, t2, t2 + t2len))) + for (const char *s = t2; s - t2 < t2len; s = fl_utf8fwd (s + 1, t2, t2 + t2len)) printf ("%3d -> U+%04x\n", (int)(s - t2), decodeUtf8(s, t2len - (s - t2))); |