提交 dde622a5 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

perf tests attr: Rename compare_data to data_equal

The data_equal name fits better to the return value of the function.
It's true when the data is equal.
Signed-off-by: NJiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20170703145030.12903-6-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 04c31bcf
...@@ -9,7 +9,7 @@ import logging ...@@ -9,7 +9,7 @@ import logging
import shutil import shutil
import ConfigParser import ConfigParser
def compare_data(a, b): def data_equal(a, b):
# Allow multiple values in assignment separated by '|' # Allow multiple values in assignment separated by '|'
a_list = a.split('|') a_list = a.split('|')
b_list = b.split('|') b_list = b.split('|')
...@@ -101,7 +101,7 @@ class Event(dict): ...@@ -101,7 +101,7 @@ class Event(dict):
log.debug(" [%s] %s %s" % (t, self[t], other[t])); log.debug(" [%s] %s %s" % (t, self[t], other[t]));
if not self.has_key(t) or not other.has_key(t): if not self.has_key(t) or not other.has_key(t):
return False return False
if not compare_data(self[t], other[t]): if not data_equal(self[t], other[t]):
return False return False
return True return True
...@@ -109,7 +109,7 @@ class Event(dict): ...@@ -109,7 +109,7 @@ class Event(dict):
for t in Event.terms: for t in Event.terms:
if not self.has_key(t) or not other.has_key(t): if not self.has_key(t) or not other.has_key(t):
continue continue
if not compare_data(self[t], other[t]): if not data_equal(self[t], other[t]):
log.warning("expected %s=%s, got %s" % (t, self[t], other[t])) log.warning("expected %s=%s, got %s" % (t, self[t], other[t]))
# Test file description needs to have following sections: # Test file description needs to have following sections:
...@@ -220,7 +220,7 @@ class Test(object): ...@@ -220,7 +220,7 @@ class Test(object):
log.info(" '%s' ret '%s', expected '%s'" % (cmd, str(ret), str(self.ret))) log.info(" '%s' ret '%s', expected '%s'" % (cmd, str(ret), str(self.ret)))
if not compare_data(str(ret), str(self.ret)): if not data_equal(str(ret), str(self.ret)):
raise Unsup(self) raise Unsup(self)
def compare(self, expect, result): def compare(self, expect, result):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册