diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2015-10-27 18:44:35 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-10-30 08:37:49 +0000 |
commit | 7a78d4113efc508fa7dcb91daa898dbb3d403a1b (patch) | |
tree | 6d9f2b027ddf3412ca8a13518d8ceef69e2f7001 /tools/dftestlib/integer.py | |
parent | 2014eb0ad3221acf319c95cd968cf11e44174137 (diff) |
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 <a.broman58@gmail.com>
Diffstat (limited to 'tools/dftestlib/integer.py')
-rwxr-xr-x | tools/dftestlib/integer.py | 19 |
1 files changed, 17 insertions, 2 deletions
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) |