From 686a45484de9e4d60d3f390aba01ecdbd767da8a Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 19 Nov 2013 22:45:16 +0100 Subject: [PATCH] ltlcross: report missing input/output sequence * src/bin/ltlcross.cc: Fix it. * src/tgbatest/ltlcross3.test: New file. * src/tgbatest/Makefile.am: Add it. * NEWS: Mention it. --- NEWS | 2 ++ src/bin/ltlcross.cc | 3 +-- src/tgbatest/Makefile.am | 1 + src/tgbatest/ltlcross3.test | 25 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 src/tgbatest/ltlcross3.test diff --git a/NEWS b/NEWS index 2b82628c0..6247d3553 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,8 @@ New in spot 1.2a (not released) * Bug fixes: - ltlcross' CSV output now stricly follows RFC 4180. + - ltlcross failed to report missing input or output escape sequences + on all but the first configured translator. New in spot 1.2 (2013-10-01) diff --git a/src/bin/ltlcross.cc b/src/bin/ltlcross.cc index a336c2fc2..16de840bb 100644 --- a/src/bin/ltlcross.cc +++ b/src/bin/ltlcross.cc @@ -690,14 +690,13 @@ namespace declare('N', &output); declare('T', &output); - std::vector has(256); size_t s = translators.size(); assert(s); for (size_t n = 0; n < s; ++n) { // Check that each translator uses at least one input and // one output. - has.clear(); + std::vector has(256); const translator_spec& t = translators[n]; scan(t.cmd, has); if (!(has['f'] || has['s'] || has['l'] || has['w'] diff --git a/src/tgbatest/Makefile.am b/src/tgbatest/Makefile.am index 1eeb1e9c3..c06f157ab 100644 --- a/src/tgbatest/Makefile.am +++ b/src/tgbatest/Makefile.am @@ -79,6 +79,7 @@ TESTS = \ eltl2tgba.test \ explicit.test \ explicit2.test \ + ltlcross3.test \ taatgba.test \ tgbaread.test \ renault.test \ diff --git a/src/tgbatest/ltlcross3.test b/src/tgbatest/ltlcross3.test new file mode 100755 index 000000000..db3f3ac3e --- /dev/null +++ b/src/tgbatest/ltlcross3.test @@ -0,0 +1,25 @@ +#!/bin/sh +# -*- coding: utf-8 -*- +# Copyright (C) 2012, 2013 Laboratoire de Recherche et +# Développement de l'Epita (LRDE). +# +# This file is part of Spot, a model checking library. +# +# Spot 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. +# +# Spot 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 . + +. ./defs +set -e + +run 2 ../../bin/ltlcross 'ltl2tgba -s %f >%N' 'foo bar' 2>stderr -f a +grep 'ltlcross.*no input.*in.*foo bar' stderr