From 520ee4f6b463114f08febd1f03866a79444fdf35 Mon Sep 17 00:00:00 2001 From: fruffy Date: Thu, 27 Oct 2022 10:27:41 -0400 Subject: [PATCH 1/2] Fix typo in program. Fix. --- backends/p4tools/testgen/test/small-step/reachability.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/p4tools/testgen/test/small-step/reachability.cpp b/backends/p4tools/testgen/test/small-step/reachability.cpp index d31d235bb0a..b8488572342 100644 --- a/backends/p4tools/testgen/test/small-step/reachability.cpp +++ b/backends/p4tools/testgen/test/small-step/reachability.cpp @@ -175,7 +175,7 @@ const IR::Node* getFromHash(const P4Tools::ReachabilityHashType& hash, const cha TEST_F(P4CReachability, testTableAndActions) { auto result = loadExampleForReachability( - "../../backends/p4tools/testgen/targets/bmv2/test/p4-programs/bmv2_hit.p4)"); + "../../backends/p4tools/testgen/targets/bmv2/test/p4-programs/bmv2_hit.p4"); const auto* program = get<0>(result); ASSERT_TRUE(program); const auto* dcg = std::get<1>(result); From 5d00e468583cf71f6eaa78fc5361f90ec65ed95e Mon Sep 17 00:00:00 2001 From: fruffy Date: Thu, 27 Oct 2022 10:41:00 -0400 Subject: [PATCH 2/2] Make const cast explicit. The option interface should change. --- backends/p4tools/testgen/test/small-step/reachability.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/p4tools/testgen/test/small-step/reachability.cpp b/backends/p4tools/testgen/test/small-step/reachability.cpp index b8488572342..7e164f7cce0 100644 --- a/backends/p4tools/testgen/test/small-step/reachability.cpp +++ b/backends/p4tools/testgen/test/small-step/reachability.cpp @@ -47,7 +47,7 @@ ReturnedInfo loadExampleForReachability(const char* curFile) { AutoCompileContext autoP4TestContext(new P4ReachabilityContext()); auto& options = P4ReachabilityContext::get().options(); const char* argv = "./p4testgen"; - options.process(1, (char* const*)&argv); + options.process(1, const_cast(&argv)); options.langVersion = CompilerOptions::FrontendVersion::P4_16; std::string includeDir = std::string(buildPath) + std::string("p4include"); auto* originalEnv = getenv("P4C_16_INCLUDE_PATH");