Esempio n. 1
0
def test_read_short_charstring_bug895(option, font_name):
    input_path = get_bad_input_path(font_name)
    output_path = runner(CMD + ['-s', '-e', '-a', '-o', option,
                                '-f', input_path])
    expected_path = get_expected_path(font_name + '.' + option)
    skip = ['-s', 'tx: ---']  # skip line with filename
    assert differ([expected_path, output_path] + skip)
Esempio n. 2
0
def test_drop_defaultwidthx_when_writing_cff2_bug897(option):
    input_path = get_bad_input_path('bug897.otf')
    output_path = get_temp_file_path()
    runner(CMD + ['-a', '-o', option, '-f', input_path, output_path])
    dcf_path = get_temp_file_path()
    runner(CMD + ['-a', '-o', 'dcf', '-f', output_path, dcf_path])
    expected_path = get_expected_path('bug897.' + option + '.dcf')
    assert differ([expected_path, dcf_path])
Esempio n. 3
0
def test_dcf_with_infinite_recursion_bug775():
    font_path = get_bad_input_path('subr_test_font_infinite_recursion.otf')
    dcf_path = get_temp_file_path()
    with pytest.raises(subprocess.CalledProcessError) as err:
        runner(CMD + ['-a', '-o', 'dcf', '-f', font_path, dcf_path])
    assert(err.value.returncode == 1)  # exit code of 1, not segfault of -11
    expected_path = get_expected_path(
        'subr_test_font_infinite_recursion.dcf.txt')
    assert differ([expected_path, dcf_path])
Esempio n. 4
0
def test_missing_glyph_names_pr905(option):
    input_path = get_bad_input_path('pr905.otf')
    output_path = get_temp_file_path()
    runner(CMD + ['-a', '-o', option, '-f', input_path, output_path])
    expected_path = get_expected_path('pr905' + '.' + option)
    if option == 'afm':
        skip = [
            '-s', 'Comment Creation Date:' + SPLIT_MARKER + 'Comment Copyright'
        ]
    else:
        skip = []
    assert differ([expected_path, output_path] + skip)
Esempio n. 5
0
def test_too_many_glyphs_pr955():
    input_path = get_bad_input_path('TooManyGlyphsCFF2.otf')
    output_path = get_temp_file_path()
    with pytest.raises(subprocess.CalledProcessError) as err:
        runner(CMD + ['-a', '-o', 'cff', '-f', input_path, output_path])
    assert(err.value.returncode > 0)  # error code, not hang or success
Esempio n. 6
0
def test_bug_940():
    input_path = get_bad_input_path('bug940_private_blend.otf')
    output_path = get_temp_file_path()
    with pytest.raises(subprocess.CalledProcessError) as err:
        runner(CMD + ['-a', '-o', 'cff2', '-f', input_path, output_path])
    assert(err.value.returncode > 0)  # error code, not segfault or success
Esempio n. 7
0
def test_bad_charset():
    font_path = get_bad_input_path('bad_charset.otf')
    save_path = get_temp_file_path()
    runner(CMD + ['-a', '-f', font_path, save_path])
    expected_path = get_expected_path('bad_charset.txt')
    assert differ([expected_path, save_path, '-s', '## Filename'])
Esempio n. 8
0
def test_missing_glyph_names_pr905_cef():
    input_path = get_bad_input_path('pr905.otf')
    output_path = get_temp_file_path()
    with pytest.raises(subprocess.CalledProcessError) as err:
        runner(CMD + ['-a', '-o', 'cef', '-f', input_path, output_path])
    assert(err.value.returncode > 0)  # error code, not segfault of -11
Esempio n. 9
0
def test_varread_errors(filename, msg):
    font_path = get_bad_input_path(f'vf_{filename}.otf')
    output = subprocess.check_output([TOOL, '-dcf', '-0', font_path],
                                     stderr=subprocess.STDOUT)
    assert msg in output