From 7a78d4113efc508fa7dcb91daa898dbb3d403a1b Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Tue, 27 Oct 2015 18:44:35 -0400 Subject: Add a few new negative dfilter tests. For example, to ensure that "field = value" is not a valid dfilter (as was recently a problem). As suggested by Alexis. Change-Id: Ibf498c30325579e3d5474bb2d397f1bbb9ffc07f Reviewed-on: https://code.wireshark.org/review/11339 Reviewed-by: Anders Broman --- tools/dftestlib/integer.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'tools/dftestlib/integer.py') diff --git a/tools/dftestlib/integer.py b/tools/dftestlib/integer.py index fca4f23cdd..4a148562a7 100755 --- a/tools/dftestlib/integer.py +++ b/tools/dftestlib/integer.py @@ -4,12 +4,12 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -28,6 +28,21 @@ class testInteger(dftest.DFTest): dfilter = "ip.version == 6" self.assertDFilterCount(dfilter, 0) + def test_eq_3(self): + # Invalid filter (only one equals sign) + dfilter = "ip.version = 4" + self.assertDFilterFail(dfilter) + + def test_eq_4(self): + # Invalid filter + dfilter = "ip.version == the quick brown fox jumps over the lazy dog" + self.assertDFilterFail(dfilter) + + def test_eq_5(self): + # Invalid filter + dfilter = "ip.version == 4 the quick brown fox jumps over the lazy dog" + self.assertDFilterFail(dfilter) + def test_ne_1(self): dfilter = "ip.version != 0" self.assertDFilterCount(dfilter, 1) -- cgit v1.2.3