From f1c595545685258840b961bfe6acecd2da56ed87 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Mon, 28 Sep 2020 17:38:49 +0800 Subject: add a unit test for loading old database --- suite/testcommon.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'suite/testcommon.py') diff --git a/suite/testcommon.py b/suite/testcommon.py index 992a7961..c5bf4895 100644 --- a/suite/testcommon.py +++ b/suite/testcommon.py @@ -1541,3 +1541,16 @@ class VerifyBuilder(Builder): self.delete_package("helloworld") callback_should_run = False + def test_load_old_database(self): + """Load a database produced by Binary Ninja v1.2.1921""" + file_name = os.path.join(os.path.dirname(__file__), self.test_store, "..", "binja_v1.2.1921_bin_ls.bndb") + if not os.path.exists(file_name): + return False + + with BinaryViewType.get_view_of_file(file_name) as bv: + if bv is None: + return False + if bv.file.snapshot_data_applied_without_error: + return True + + return False -- cgit v1.3.1