From ddc3ad9312fc6feef5b90c429d5d8d7cfcf8bf47 Mon Sep 17 00:00:00 2001
From: pompolic <pompolic@special-circumstanc.es>
Date: Mon, 8 May 2023 22:12:07 +0200
Subject: [PATCH] Test shouldn't fail when bytes_used is empty

---
 gdb-port/tests/unit/top-level-parse.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb-port/tests/unit/top-level-parse.py b/gdb-port/tests/unit/top-level-parse.py
index 48b17d1..199fdb6 100644
--- a/gdb-port/tests/unit/top-level-parse.py
+++ b/gdb-port/tests/unit/top-level-parse.py
@@ -87,7 +87,7 @@ class TopLevelParseStateManagement(unittest.TestCase):
 		self.top_level_parse.parser_objs[32] = self.parser1
 		self.top_level_parse.enter_h_do_parse(16, self._arena, self.parser1.address)
 		self.top_level_parse.enter_h_arena_malloc_raw(256)
-		self.assertEqual(self.parser1.bytes_used[int(self._arena)], 256)
+		self.assertEqual(self.parser1.bytes_used.get(int(self._arena), None), 256)
 
 	# A bit hacky: relying on the top_level_parse initialized by top-level-parse.py, because we have no reference to the testcase
 	@unittest.skipIf(top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS, "malloc-based allocation counts disabled")
-- 
GitLab