Files
ViewDesignEngine/tests/fuzz/fuzz_format.cpp
T

41 lines
1.0 KiB
C++
Raw Normal View History

#include <gtest/gtest.h>
#include "vde/brep/iges_export.h"
#include "vde/brep/iges_import.h"
#include "vde/brep/step_export.h"
#include "vde/brep/step_import.h"
#include "vde/brep/modeling.h"
using namespace vde::brep;
// ── Format fuzz: IGES round-trip ──
TEST(FuzzFormat, IgesRoundTrip) {
for (int i = 0; i < 10; ++i) {
double s = 0.5 + i * 0.5;
auto box = make_box(s, s, s);
std::string iges = export_iges({box});
EXPECT_FALSE(iges.empty());
auto loaded = import_iges_from_string(iges);
EXPECT_FALSE(loaded.empty());
EXPECT_TRUE(loaded[0].is_valid());
}
}
// ── Format fuzz: STEP round-trip ──
TEST(FuzzFormat, StepRoundTrip) {
for (int i = 0; i < 10; ++i) {
double s = 0.5 + i * 0.5;
auto box = make_box(s, s, s);
std::string step = export_step({box});
EXPECT_FALSE(step.empty());
auto loaded = import_step_from_string(step);
EXPECT_FALSE(loaded.empty());
EXPECT_TRUE(loaded[0].is_valid());
}
}