From 189444f19998ae05b5e7395f3036d35a8419aed2 Mon Sep 17 00:00:00 2001
From: Jason Hiser <jdhiser@gmail.com>
Date: Wed, 4 Sep 2019 21:15:20 -0400
Subject: [PATCH] updated testing harness to handle bad files and expected
 exception throwing better

---
 test/test.cpp | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/test/test.cpp b/test/test.cpp
index fd0cd75..572bb2f 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -60,11 +60,24 @@ int main(int argc, char* argv[])
 		usage(argc,argv);
 	}
 
-	auto ehp = EHFrameParser_t::factory(argv[1]);
-	ehp->print();
+	try
+	{
+		auto ehp = EHFrameParser_t::factory(argv[1]);
+		ehp->print();
 
 
-	print_lps(ehp.get());
+		print_lps(ehp.get());
+	}
+	catch(const exception& e )
+	{
+		cout <<" libehp threw an exception, this may or may not be an error depending on the input file" << endl;
+		cout << e.what() << endl;
+	}
+	catch(...)
+	{
+		cout <<" ehp threw an exception of an unknonwn type -- this shouldn't happen " << endl;
+		abort();
+	};
 
 	return 0;
 }
-- 
GitLab