From 3ca81c2dc3881aec0bbf94646c73a148d706c76d Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Sun, 29 Oct 2023 16:00:02 +0000 Subject: Change `GetConstraintLog` to work with `std::string`s instead of `char*`s --- unittests/Solver/Z3SolverTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'unittests/Solver') diff --git a/unittests/Solver/Z3SolverTest.cpp b/unittests/Solver/Z3SolverTest.cpp index 0eba3d0e..9f4a4786 100644 --- a/unittests/Solver/Z3SolverTest.cpp +++ b/unittests/Solver/Z3SolverTest.cpp @@ -63,9 +63,9 @@ TEST_F(Z3SolverTest, GetConstraintLog) { // Ensure this is not buggy as fixed in https://github.com/klee/klee/pull/1235 // If the bug is still present this fail due to an internal assertion - char *ConstraintsString = Z3Solver_->getConstraintLog(TheQuery); + std::string ConstraintsString = Z3Solver_->getConstraintLog(TheQuery); const char *ExpectedArraySelection = "(= (select const_array_0"; - const char *Occurence = std::strstr(ConstraintsString, ExpectedArraySelection); + const char *Occurence = + std::strstr(ConstraintsString.c_str(), ExpectedArraySelection); ASSERT_STRNE(Occurence, nullptr); - free(ConstraintsString); } -- cgit 1.4.1