[liblouis-liblouisxml] [liblouis] r566 committed - Add a test case demonstrating the problems with pass2 and output_pos

  • From: liblouis@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Fri, 13 Apr 2012 12:45:55 +0000

Revision: 566
Author:   christian.egli@xxxxxxxxxxxxxx
Date:     Fri Apr 13 05:45:35 2012
Log: Add a test case demonstrating the problems with pass2 and output_pos

http://code.google.com/p/liblouis/source/detail?r=566

Added:
 /trunk/tests/pass2_outpos.c
Modified:
 /trunk/ChangeLog
 /trunk/tests/Makefile.am
 /trunk/tests/tables/pass2.ctb

=======================================
--- /dev/null
+++ /trunk/tests/pass2_outpos.c Fri Apr 13 05:45:35 2012
@@ -0,0 +1,36 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "brl_checks.h"
+
+int
+main(int argc, char **argv)
+{
+
+  const char* table = "pass2.ctb";
+
+  int result = 0;
+
+  /* First check a plain word to see if outpos handling generally
+     works */
+  const char* str1 = "Rene";
+  const int expected_outpos1[] = {0,1,2,3,3};
+
+  result |= check_outpos(table, str1, expected_outpos1);
+
+  /* then try a word which uses pass2 and makes the output longer */
+  const char* str2 = "Reno";
+  const int expected_pos2[] = {0,1,2,3,3};
+
+  result |= check_outpos(table, str2, expected_pos2);
+
+  /* finally try a word also uses pass2, deletes a char from the
+     output and essentially shortens the output */
+  const char* str3 = "xRen";
+  const int expected_pos3[] = {1,2,3};
+
+  result |= check_outpos(table, str3, expected_pos3);
+
+  return result;
+
+}
=======================================
--- /trunk/ChangeLog    Fri Apr 13 05:18:42 2012
+++ /trunk/ChangeLog    Fri Apr 13 05:45:35 2012
@@ -1,5 +1,9 @@
 2012-04-13  Christian Egli  <christian.egli@xxxxxx>

+       * tests/Makefile.am:
+       * tests/tables/pass2.ctb:
+       * tests/pass2_outpos.c: Add a test for the problem with pass2 and 
outpos.
+
        * tests/brl_checks.h:
        * tests/brl_checks.c (check_outpos):
        * tests/inpos_compbrl.c (main): Enhance so that output position
=======================================
--- /trunk/tests/Makefile.am    Wed Apr  4 02:59:21 2012
+++ /trunk/tests/Makefile.am    Fri Apr 13 05:45:35 2012
@@ -14,9 +14,9 @@
        brl_checks.h            \
        capitalized_word.c

-capitalized_with_sentance_SOURCES =    \
-       brl_checks.c            \
-       brl_checks.h            \
+capitalized_with_sentance_SOURCES =            \
+       brl_checks.c                            \
+       brl_checks.h                            \
        capitalized_with_sentance.c

 inpos_compbrl_SOURCES =                \
@@ -34,29 +34,35 @@
        brl_checks.h            \
        en_gb_g1_italics.c

-pass2_SOURCES =                                        \
-       brl_checks.c                            \
-       brl_checks.h                            \
+pass2_SOURCES =                        \
+       brl_checks.c            \
+       brl_checks.h            \
        pass2.c

-letterDefTest_SOURCES =                        \
-       brl_checks.c                            \
-       brl_checks.h                            \
+pass2_outpos_SOURCES =         \
+       brl_checks.c            \
+       brl_checks.h            \
+       pass2_outpos.c
+
+letterDefTest_SOURCES =        \
+       brl_checks.c            \
+       brl_checks.h            \
        letterDefTest.c

-check_PROGRAMS =                               \
-       pass2                                   \
-       present_progressive                     \
-       capitalized_word                        \
-       capitalized_with_sentance               \
-       inpos_compbrl                           \
-       lastworditalafter                       \
-       en_gb_g1_italics \
+check_PROGRAMS =                       \
+       pass2                           \
+       pass2_outpos                    \
+       present_progressive             \
+       capitalized_word                \
+       capitalized_with_sentance       \
+       inpos_compbrl                   \
+       lastworditalafter               \
+       en_gb_g1_italics                \
        letterDefTest

-dist_check_SCRIPTS = \
-       check_all_tables.pl \
-       check_endless_loop.pl \
+dist_check_SCRIPTS =           \
+       check_all_tables.pl     \
+       check_endless_loop.pl   \
        multiple_table_path.pl

 # if we have Python and liblouis is configured with ucs4 then we can
@@ -72,20 +78,20 @@
 # The present_progressive should not really fail but for the moment
 # the issue doesn't seem to be critical enough that anybody has enough
 # interest to fix it.
-XFAIL_TESTS = \
-       present_progressive     \
+XFAIL_TESTS =                  \
+       present_progressive     \
        lastworditalafter       \
        en_gb_g1_italics

-TESTS =        \
-       $(check_PROGRAMS) \
+TESTS =                                \
+       $(check_PROGRAMS)       \
        $(dist_check_SCRIPTS)

 HARNESS_DIR = $(top_srcdir)/tests/harness

-TESTS_ENVIRONMENT = \
-       LOUIS_TABLEPATH=$(top_srcdir)/tables,$(top_srcdir)/tests/tables \
-       PYTHONPATH=$(HARNESS_DIR):$(top_srcdir)/python:$$PYTHONPATH \
-       HARNESS_DIR=$(HARNESS_DIR) \
-       LD_LIBRARY_PATH=$(top_srcdir)/liblouis/.libs:$$LD_LIBRARY_PATH \
+TESTS_ENVIRONMENT =                                                    \
+       LOUIS_TABLEPATH=$(top_srcdir)/tables,$(top_srcdir)/tests/tables \
+       PYTHONPATH=$(HARNESS_DIR):$(top_srcdir)/python:$$PYTHONPATH     \
+       HARNESS_DIR=$(HARNESS_DIR)                                      \
+       LD_LIBRARY_PATH=$(top_srcdir)/liblouis/.libs:$$LD_LIBRARY_PATH  \
        PATH=$(top_srcdir)/tools:$$PATH
=======================================
--- /trunk/tests/tables/pass2.ctb       Fri Mar 23 08:52:09 2012
+++ /trunk/tests/tables/pass2.ctb       Fri Apr 13 05:45:35 2012
@@ -2,8 +2,10 @@
uplow Nn 1345 LATIN CAPITAL LETTER N - LATIN SMALL LETTER N uplow Rr 1235 LATIN CAPITAL LETTER R - LATIN SMALL LETTER R
 uplow       Oo  135                LATIN CAPITAL LETTER O - LATIN SMALL LETTER 
O
+uplow       Xx  1346

 punctuation ' 6                    APOSTROPHE APOSTROPHE-QUOTE

 pass2 @135   @6-135
-
+pass2 @1346  ?
+
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts:

  • » [liblouis-liblouisxml] [liblouis] r566 committed - Add a test case demonstrating the problems with pass2 and output_pos - liblouis