tools/pci: refactor PCI bridge
Use polymorphism to handle the differences between Aspeed and Nuvoton
PCI devices.
Add unit tests (now at 100% line coverage for tools/pci.cpp).
Signed-off-by: Benjamin Fair <benjaminfair@google.com>
Change-Id: I43e63ec5eb9fce5fb0fc74e0e69667dd13b7433f
diff --git a/tools/tool_errors.hpp b/tools/tool_errors.hpp
index cf898e6..96dfa10 100644
--- a/tools/tool_errors.hpp
+++ b/tools/tool_errors.hpp
@@ -20,4 +20,11 @@
std::string message;
};
+class NotFoundException : public ToolException
+{
+ public:
+ explicit NotFoundException(const std::string& device) :
+ ToolException(std::string("Couldn't find " + device)){};
+};
+
} // namespace host_tool