fix: add modeling.h include to test_io_gltf
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <fstream>
|
||||
#include <cstdio>
|
||||
#include "vde/foundation/io_gltf.h"
|
||||
#include "vde/brep/modeling.h"
|
||||
|
||||
using namespace vde::foundation;
|
||||
using namespace vde::mesh;
|
||||
@@ -88,15 +89,24 @@ TEST(IoGltfTest, ExportWithNormals) {
|
||||
std::ifstream f(path, std::ios::binary);
|
||||
ASSERT_TRUE(f.good());
|
||||
|
||||
// Skip header (12 bytes)
|
||||
f.seekg(12);
|
||||
// Read header
|
||||
uint32_t magic = 0, version = 0, total_len = 0;
|
||||
f.read(reinterpret_cast<char*>(&magic), 4);
|
||||
f.read(reinterpret_cast<char*>(&version), 4);
|
||||
f.read(reinterpret_cast<char*>(&total_len), 4);
|
||||
EXPECT_EQ(magic, 0x46546C67u);
|
||||
|
||||
// Read JSON chunk
|
||||
// Read JSON chunk header
|
||||
uint32_t chunk_len = 0, chunk_type = 0;
|
||||
f.read(reinterpret_cast<char*>(&chunk_len), 4);
|
||||
f.read(reinterpret_cast<char*>(&chunk_type), 4);
|
||||
EXPECT_EQ(chunk_type, 0x4E4F534Au);
|
||||
|
||||
// Read unpadded JSON data + skip padding
|
||||
std::string json(chunk_len, '\0');
|
||||
f.read(&json[0], chunk_len);
|
||||
size_t padding = (4 - (chunk_len % 4)) % 4;
|
||||
f.seekg(static_cast<std::streamoff>(padding), std::ios::cur);
|
||||
|
||||
EXPECT_NE(json.find("\"NORMAL\""), std::string::npos)
|
||||
<< "JSON should include NORMAL attribute when normals enabled";
|
||||
|
||||
Reference in New Issue
Block a user