From: Aina Niemetz Date: Tue, 4 Jan 2022 01:00:06 +0000 (-0800) Subject: api: Remove redundant check in Term::toString(). (#7866) X-Git-Tag: cvc5-1.0.0~613 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f0891f4ff824672f7423705de96d055d578d74a2;p=cvc5.git api: Remove redundant check in Term::toString(). (#7866) --- diff --git a/src/api/cpp/cvc5.cpp b/src/api/cpp/cvc5.cpp index 423b09cec..eaea15b76 100644 --- a/src/api/cpp/cvc5.cpp +++ b/src/api/cpp/cvc5.cpp @@ -2679,10 +2679,6 @@ std::string Term::toString() const { CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line - if (d_solver != nullptr) - { - return d_node->toString(); - } return d_node->toString(); //////// CVC5_API_TRY_CATCH_END; diff --git a/test/unit/api/cpp/term_black.cpp b/test/unit/api/cpp/term_black.cpp index bb57612b2..dc0d5fd43 100644 --- a/test/unit/api/cpp/term_black.cpp +++ b/test/unit/api/cpp/term_black.cpp @@ -1126,5 +1126,7 @@ TEST_F(TestApiBlackTerm, termScopedToString) Solver solver2; ASSERT_EQ(x.toString(), "x"); } + +TEST_F(TestApiBlackTerm, toString) { ASSERT_NO_THROW(Term().toString()); } } // namespace test } // namespace cvc5