Files
Aethera/web_server/tests/Gallery_Plots_Tests.cpp
T
2026-08-28 14:10:36 +08:00

34 lines
1.2 KiB
C++

#include <mcp/core/runtime/Gallery_Plots.hpp>
#include <gtest/gtest.h>
#include <unordered_set>
namespace aethera::web {
namespace {
TEST(Gallery_Plots, Catalog_Is_Complete_And_Unique) {
const auto definitions = gallery_plot_definitions();
ASSERT_FALSE(definitions.empty());
std::unordered_set<std::string_view> identifiers;
bool has_2d{};
bool has_3d{};
for (const auto& definition : definitions) {
EXPECT_FALSE(definition.id.empty());
EXPECT_FALSE(definition.title.empty());
EXPECT_FALSE(definition.category.empty());
EXPECT_FALSE(definition.description.empty());
EXPECT_NE(definition.create, nullptr);
EXPECT_TRUE(identifiers.insert(definition.id).second)
<< "duplicate plot id: " << definition.id;
const auto found = find_gallery_plot_definition(definition.id);
ASSERT_TRUE(found);
EXPECT_EQ(found, &definition);
has_2d |= definition.dimension == Plot_Dimension::two_d;
has_3d |= definition.dimension == Plot_Dimension::three_d;
}
EXPECT_TRUE(has_2d);
EXPECT_TRUE(has_3d);
EXPECT_FALSE(find_gallery_plot_definition("not-a-plot"));
}
}
}