Commits (3)
......@@ -24,7 +24,7 @@ from diffoscope.config import Config
from diffoscope.comparators.android import AndroidBootImgFile
from diffoscope.comparators.missing_file import MissingFile
from ..utils.data import load_fixture, get_data
from ..utils.data import load_fixture, assert_diff
from ..utils.tools import skip_unless_tools_exist
bootimg1 = load_fixture("android1.img")
......@@ -52,8 +52,7 @@ def differences(bootimg1, bootimg2):
@skip_unless_tools_exist("abootimg")
@pytest.mark.skipif(bearch, reason="abootimg is buggy on BE architectures")
def test_diff(differences):
expected_diff = get_data("android_expected_diff")
assert differences[0].unified_diff == expected_diff
assert_diff(differences[0], "android_expected_diff")
@skip_unless_tools_exist("abootimg")
......
......@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.berkeley_db import BerkeleyDBFile
from ..utils.data import load_fixture, get_data
from ..utils.data import load_fixture, assert_diff
from ..utils.tools import skip_unless_tools_exist
from ..utils.nonexisting import assert_non_existing
......@@ -45,8 +45,7 @@ def test_no_differences(db1):
@skip_unless_tools_exist("db_dump")
def test_diff(differences):
expected_diff = get_data("berkeley_db_expected_diff")
assert differences[0].unified_diff == expected_diff
assert_diff(differences[0], "berkeley_db_expected_diff")
@skip_unless_tools_exist("db_dump")
......
......@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.docx import DocxFile
from ..utils.data import load_fixture, get_data
from ..utils.data import load_fixture, assert_diff
from ..utils.tools import skip_unless_tools_exist
from ..utils.nonexisting import assert_non_existing
......@@ -45,8 +45,7 @@ def differences(docx1, docx2):
@skip_unless_tools_exist("docx2txt")
def test_diff(differences):
expected_diff = get_data("docx_expected_diff")
assert differences[0].unified_diff == expected_diff
assert_diff(differences[0], "docx_expected_diff")
@skip_unless_tools_exist("docx2txt")
......
......@@ -27,7 +27,7 @@ from diffoscope.config import Config
from diffoscope.comparators.dtb import DeviceTreeFile
from diffoscope.comparators.missing_file import MissingFile
from ..utils.data import load_fixture, get_data
from ..utils.data import load_fixture, assert_diff
from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
# Generated by: dtc --in-format=dts --out-format=dtb --out=devicetree1.dtb devicetree1.dts
......@@ -64,8 +64,7 @@ def differences(dtb1, dtb2):
@skip_unless_tool_is_at_least("fdtdump", fdtdump_version, "1.4.2")
def test_diff(differences):
expected_diff = get_data("devicetree_expected_diff")
assert differences[0].unified_diff == expected_diff
assert_diff(differences[0], "devicetree_expected_diff")
@skip_unless_tools_exist("fdtdump")
......
......@@ -24,7 +24,7 @@ import subprocess
from diffoscope.comparators.ppu import PpuFile
from ..utils.data import load_fixture, get_data
from ..utils.data import load_fixture, assert_diff
from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
from ..utils.nonexisting import assert_non_existing
......@@ -61,12 +61,11 @@ def differences(file1, file2):
return file1.compare(file2).details
@skip_unless_tool_is_at_least("ppudump", ppudump_version, "3.0.0")
@skip_unless_tool_is_at_least("ppudump", ppudump_version, "3.2.0")
def test_diff(differences):
expected_diff = get_data("ppu_expected_diff")
assert differences[0].unified_diff == expected_diff
assert_diff(differences[0], "ppu_expected_diff")
@skip_unless_tool_is_at_least("ppudump", ppudump_version, "3.0.0")
@skip_unless_tool_is_at_least("ppudump", ppudump_version, "3.2.0")
def test_compare_non_existing(monkeypatch, file1):
assert_non_existing(monkeypatch, file1, has_null_source=False)
@@ -15,15 +15,15 @@
Definitions stored : 121
Symbols stored : 398
@@ -4,26 +4,26 @@
Header
-------
Compiler version : 3.2.0
Target processor : x86_64
Target operating system : Linux-x86-64
Unit flags : no_link, little_endian, release, local_symtable
-FileSize (w/o header) : 756
-Checksum : 3CCDD3E4
-Interface Checksum : 800507DD
+FileSize (w/o header) : 812
+Checksum : 0ABC639D
+Interface Checksum : 8061E805
Indirect Checksum : 2A5CA015
Definitions stored : 1
Symbols stored : 4
Interface section
------------------
Module Name: CastleGenericLists
-Source file 1 : castlegenericlists.pas 2016/02/17 15:03:46
+Source file 1 : castlegenericlists.pas 2016/02/17 15:04:53
Uses unit: System (Crc: 09C1FD4E, IntfcCrc: 3A093E2F, IndCrc: FEDD6E0A)
Uses unit: objpas (Crc: 663BC437, IntfcCrc: CA7886A2, IndCrc: 64D020AC)
Uses unit: fgl (Crc: C38E0A5A, IntfcCrc: 470D2834, IndCrc: 0764D076)
Link unit object file: castlegenericlists.o (static )
DerefMapsize: 2
DerefMap[0] = FGL
DerefMap[1] = SYSTEM
-Module Name: CastleInternalPng
+Module Name: CastleInternalDoubleLists
-Source file 1 : castleinternalpng.pas 2018/01/21 10:59:47
+Source file 1 : castleinternaldoublelists.pas 2018/01/21 10:59:47
Source file 2 : castleconf.inc 2020/08/10 16:13:09
Uses unit: System (Crc: 834E727C, IntfcCrc: 11606A94, IndCrc: E1A3CEBA)
Uses unit: objpas (Crc: 8ADEDA2C, IntfcCrc: 2E3EFC00, IndCrc: CBFF6EAF)
DerefMapsize: 1
DerefMap[0] = SYSTEM
Derefdata length: 27
@@ -34,26 +34,26 @@
Interface definitions
----------------------
Interface Symbols
------------------
Symtable count: 3
** Symbol Id 0 **
-Unit symbol CastleInternalPng
- File Pos : 1 (16,1)
+Unit symbol CastleInternalDoubleLists
+ File Pos : 1 (22,1)
Visibility : public
SymOptions :
** Symbol Id 1 **
Unit symbol SYSTEM
- File Pos : 1 (16,10)
+ File Pos : 1 (22,10)
Visibility : public
SymOptions :
** Symbol Id 2 **
Unit symbol OBJPAS
- File Pos : 1 (19,15)
+ File Pos : 1 (34,15)
Visibility : public
SymOptions :
Interface Macro Symbols
-----------------------
(no exported macros)
@@ -84,36 +84,36 @@
Type symbol : (0) Nil
DefOptions :
DefStates :
Return type : (4) Unit 0, DefId 3
TypeOption : UnitInit
CallOption : Register
Options : HasCallingConvention, HasMangledName, Global
- Mangled name : CASTLEINTERNALPNG_$$_init$
+ Mangled name : CASTLEINTERNALDOUBLELISTS_$$_init$
Number : 65535
Level : 1
Class : (13) Nil
Procsym : (15) SymId 3
- File Pos : 1 (20,1)
+ File Pos : 1 (44,1)
Visibility : hidden
SymOptions :
Import Nr : 0
- Alias names : INIT$_$CASTLEINTERNALPNG, CASTLEINTERNALPNG_$$_init$
+ Alias names : INIT$_$CASTLEINTERNALDOUBLELISTS, CASTLEINTERNALDOUBLELISTS_$$_init$
------ parast ------
Symtable options: none
------ parast ------
------ parast ------
Symtable count: 0
Static Symbols
------------------
Symtable count: 1
** Symbol Id 3 **
-Procedure symbol $CASTLEINTERNALPNG_$$_init$
- File Pos : 1 (20,1)
+Procedure symbol $CASTLEINTERNALDOUBLELISTS_$$_init$
+ File Pos : 1 (44,1)
Visibility : public
SymOptions :
Definition : (21) DefId 0
WPO info
--------
** Instantiated Object/Class types: 0 **
No preview for this file type
No preview for this file type
......@@ -47,6 +47,10 @@ def get_data(filename):
return f.read()
def assert_diff(difference, filename):
assert difference.unified_diff == get_data(filename)
# https://code.activestate.com/recipes/576620-changedirectory-context-manager/#c3
@contextlib.contextmanager
def cwd_data():
......