未验证 提交 b65bad18 编写于 作者: E Ebrahim Byagowi 提交者: GitHub

[fuzz] Don't fail when blob is empty

And enable more tests able to trig the issue.
上级 7a9d643c
......@@ -42,7 +42,7 @@ trySubset (hb_face_t *face,
unsigned int bytes_count = 0;
for (unsigned int i = 0; i < length; ++i)
if (data[i]) ++bytes_count;
assert (bytes_count);
assert (bytes_count || !length);
hb_blob_destroy (blob);
}
......
......@@ -33,7 +33,7 @@ def cmd(command):
def timeout(p, is_killed):
is_killed['value'] = True
p.kill()
timer = threading.Timer (2, timeout, [p, is_killed])
timer = threading.Timer (5, timeout, [p, is_killed])
try:
timer.start()
......@@ -82,6 +82,8 @@ def run_dir (parent_path):
global fails
for file in os.listdir (parent_path):
path = os.path.join(parent_path, file)
# TODO: Run on all the fonts not just subset related ones
if "subset" not in path: continue
print ("running subset fuzzer against %s" % path)
if valgrind:
......@@ -91,7 +93,7 @@ def run_dir (parent_path):
if 'error' in text:
returncode = 1
if not valgrind and text.strip ():
if (not valgrind or returncode) and text.strip ():
print (text)
if returncode != 0:
......@@ -100,8 +102,7 @@ def run_dir (parent_path):
run_dir (os.path.join (srcdir, "..", "subset", "data", "fonts"))
# TODO running these tests very slow tests. Fix and re-enable
#run_dir (os.path.join (srcdir, "fonts"))
run_dir (os.path.join (srcdir, "fonts"))
if fails:
print ("%i subset fuzzer related tests failed." % fails)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册