[gnumeric] Conditional formats: cleanups and more tests.



commit bcb8f5affe15c90340bf5193cbbcd353d2d845fb
Author: Morten Welinder <terra gnome org>
Date:   Fri Mar 14 13:04:35 2014 -0400

    Conditional formats: cleanups and more tests.

 samples/cond-format-tests.gnumeric |  Bin 2783 -> 2859 bytes
 src/style-conditions.c             |    5 +++--
 test/t6150-ods-syntax.pl           |    1 +
 test/t6151-gnumeric-syntax.pl      |    1 +
 test/t6152-xlsx-syntax.pl          |    1 +
 test/t6515-cond-format.pl          |   12 +++++-------
 6 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/samples/cond-format-tests.gnumeric b/samples/cond-format-tests.gnumeric
index b0a29b3..0f851f4 100644
Binary files a/samples/cond-format-tests.gnumeric and b/samples/cond-format-tests.gnumeric differ
diff --git a/src/style-conditions.c b/src/style-conditions.c
index bdbe9f6..a28865e 100644
--- a/src/style-conditions.c
+++ b/src/style-conditions.c
@@ -883,7 +883,6 @@ gnm_style_conditions_eval (GnmStyleConditions const *sc, GnmEvalPos const *ep)
 {
        unsigned i;
        GPtrArray const *conds;
-       GnmParsePos pp;
        GnmCell const *cell = sheet_cell_get (ep->sheet, ep->eval.col, ep->eval.row);
        GnmValue const *cv = cell ? cell->value : NULL;
 
@@ -891,9 +890,11 @@ gnm_style_conditions_eval (GnmStyleConditions const *sc, GnmEvalPos const *ep)
        g_return_val_if_fail (sc->conditions != NULL, -1);
 
        conds = sc->conditions;
-       parse_pos_init_evalpos (&pp, ep);
 
        if (debug_style_conds ()) {
+               GnmParsePos pp;
+               parse_pos_init_evalpos (&pp, ep);
+
                g_printerr ("Evaluating conditions %p at %s with %d clauses\n",
                            sc,
                            parsepos_as_string (&pp),
diff --git a/test/t6150-ods-syntax.pl b/test/t6150-ods-syntax.pl
index af12400..82318aa 100755
--- a/test/t6150-ods-syntax.pl
+++ b/test/t6150-ods-syntax.pl
@@ -54,6 +54,7 @@ my @sources =
      "$samples/auto-filter-tests.gnumeric",
      "$samples/cell-comment-tests.gnumeric",
      "$samples/colrow-tests.gnumeric",
+     "$samples/cond-format-tests.gnumeric",
      "$samples/formula-tests.gnumeric",
      "$samples/merge-tests.gnumeric",
      "$samples/number-tests.gnumeric",
diff --git a/test/t6151-gnumeric-syntax.pl b/test/t6151-gnumeric-syntax.pl
index e3c625d..0f47fed 100755
--- a/test/t6151-gnumeric-syntax.pl
+++ b/test/t6151-gnumeric-syntax.pl
@@ -50,6 +50,7 @@ my @sources =
      "$samples/auto-filter-tests.gnumeric",
      "$samples/cell-comment-tests.gnumeric",
      "$samples/colrow-tests.gnumeric",
+     "$samples/cond-format-tests.gnumeric",
      "$samples/formula-tests.gnumeric",
      "$samples/merge-tests.gnumeric",
      "$samples/number-tests.gnumeric",
diff --git a/test/t6152-xlsx-syntax.pl b/test/t6152-xlsx-syntax.pl
index c4caef4..50f2c48 100755
--- a/test/t6152-xlsx-syntax.pl
+++ b/test/t6152-xlsx-syntax.pl
@@ -56,6 +56,7 @@ my @sources =
      "$samples/auto-filter-tests.gnumeric",
      "$samples/cell-comment-tests.gnumeric",
      "$samples/colrow-tests.gnumeric",
+     "$samples/cond-format-tests.gnumeric",
      "$samples/formula-tests.gnumeric",
      "$samples/merge-tests.gnumeric",
      "$samples/number-tests.gnumeric",
diff --git a/test/t6515-cond-format.pl b/test/t6515-cond-format.pl
index 61bd763..f4a71dc 100755
--- a/test/t6515-cond-format.pl
+++ b/test/t6515-cond-format.pl
@@ -16,8 +16,7 @@ my $file = "$samples/cond-format-tests.gnumeric";
 &test_roundtrip ($file,
                 'format' => 'Gnumeric_OpenCalc:odf',
                 'ext' => "ods",
-                'filter2' => "$PERL -p -e '\$_ = \"\" if m{<meta:generator>}'",
-                'ignore_failure' => 1);
+                'filter2' => "$PERL -p -e '\$_ = \"\" if m{<meta:generator>}'");
 
 my $xls_codepage_filter = "$PERL -p -e '\$_ = \"\" if m{<meta:user-defined meta:name=.msole:codepage.}'";
 
@@ -26,18 +25,17 @@ my $xls_codepage_filter = "$PERL -p -e '\$_ = \"\" if m{<meta:user-defined meta:
                 'format' => 'Gnumeric_Excel:excel_biff7',
                 'ext' => "xls",
                 'resize' => '16384x256',
-                'filter2' => $xls_codepage_filter,
-                'ignore_failure' => 1);
+                'filter2' => $xls_codepage_filter);
 
 &message ("Check conditional format xls/BIFF8 roundtrip.");
 &test_roundtrip ($file,
                 'format' => 'Gnumeric_Excel:excel_biff8',
                 'ext' => "xls",
-                'filter2' => $xls_codepage_filter,
-                'ignore_failure' => 1);
+                'filter2' => $xls_codepage_filter);
 
 &message ("Check conditional format xlsx roundtrip.");
 &test_roundtrip ($file,
                 'format' => 'Gnumeric_Excel:xlsx',
                 'ext' => "xlsx",
-                'resize' => '1048576x16384');
+                'resize' => '1048576x16384',
+                'ignore_failure' => 1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]