2022-03-16 13:26:09 -07:00
|
|
|
/******************************************************************************
|
|
|
|
|
* Top contributors (to current version):
|
2024-03-12 09:35:09 -07:00
|
|
|
* Mathias Preiner, Aina Niemetz
|
2022-03-16 13:26:09 -07:00
|
|
|
*
|
|
|
|
|
* This file is part of the cvc5 project.
|
|
|
|
|
*
|
2025-01-23 09:54:20 -08:00
|
|
|
* Copyright (c) 2009-2025 by the authors listed in the file AUTHORS
|
2022-03-16 13:26:09 -07:00
|
|
|
* in the top-level source directory and their institutional affiliations.
|
|
|
|
|
* All rights reserved. See the file COPYING in the top-level source
|
|
|
|
|
* directory for licensing information.
|
|
|
|
|
* ****************************************************************************
|
|
|
|
|
*
|
|
|
|
|
* Black box testing of the Kind enum of the C++ API.
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-07 15:39:29 -08:00
|
|
|
#include <cvc5/cvc5.h>
|
|
|
|
|
|
2022-03-16 13:26:09 -07:00
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
|
|
#include "base/output.h"
|
2023-03-07 15:39:29 -08:00
|
|
|
#include "gtest/gtest.h"
|
2022-03-16 13:26:09 -07:00
|
|
|
|
2022-03-29 16:23:01 -07:00
|
|
|
namespace cvc5::internal {
|
2022-03-16 13:26:09 -07:00
|
|
|
|
|
|
|
|
namespace test {
|
|
|
|
|
|
|
|
|
|
class TestApiKind : public ::testing::Test
|
|
|
|
|
{
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TEST_F(TestApiKind, kindToString)
|
|
|
|
|
{
|
2023-08-22 11:17:16 -07:00
|
|
|
for (int32_t k = static_cast<int32_t>(Kind::INTERNAL_KIND);
|
|
|
|
|
k < static_cast<int32_t>(Kind::LAST_KIND);
|
|
|
|
|
++k)
|
2022-03-16 13:26:09 -07:00
|
|
|
{
|
2024-02-13 15:23:08 -08:00
|
|
|
auto kindstr = std::to_string(static_cast<Kind>(k));
|
2023-08-22 11:17:16 -07:00
|
|
|
if (k == static_cast<int32_t>(Kind::INTERNAL_KIND))
|
2022-03-16 13:26:09 -07:00
|
|
|
{
|
2024-02-13 18:10:25 -08:00
|
|
|
ASSERT_EQ(kindstr, "INTERNAL_KIND");
|
2022-03-16 13:26:09 -07:00
|
|
|
}
|
2023-08-22 11:17:16 -07:00
|
|
|
else if (k == static_cast<int32_t>(Kind::UNDEFINED_KIND))
|
2022-03-16 13:26:09 -07:00
|
|
|
{
|
2024-02-13 18:10:25 -08:00
|
|
|
ASSERT_EQ(kindstr, "UNDEFINED_KIND");
|
2022-03-16 13:26:09 -07:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// If this assertion fails, s_kinds in cvc5.cpp is missing kind k.
|
2024-02-13 18:10:25 -08:00
|
|
|
ASSERT_NE(kindstr, "UNDEFINED_KIND");
|
|
|
|
|
ASSERT_NE(kindstr, "INTERNAL_KIND");
|
2022-03-16 13:26:09 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace test
|
2022-03-29 16:23:01 -07:00
|
|
|
} // namespace cvc5::internal
|