KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_glb_utils.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <vector>
#include <json_common.h>
#include <wx/filename.h>
#include <exporters/step/glb_utils.h>

Go to the source code of this file.

Classes

struct  GLB_VALIDATION
 

Functions

static GLB_VALIDATION ValidateGlbFile (const wxString &aPath)
 
static wxString GetTestGlbPath (const wxString &aFilename)
 
static wxString WriteTempGlb (const nlohmann::json &aGltf, const wxString &aPrefix)
 
 BOOST_AUTO_TEST_CASE (BadGlbHasOddLinesCount)
 
 BOOST_AUTO_TEST_CASE (GoodGlbHasNoOddLinesCount)
 
 BOOST_AUTO_TEST_CASE (FixGlbCorrectsBadFile)
 
 BOOST_AUTO_TEST_CASE (FixGlbDoesNotModifyGoodFile)
 
 BOOST_AUTO_TEST_CASE (FixGlbClonesSharedAccessor)
 
 BOOST_AUTO_TEST_CASE (FixGlbDropsSingleIndexLine)
 
 BOOST_AUTO_TEST_CASE (FixGlbBailsOnLoneSingleIndexLine)
 
 BOOST_AUTO_TEST_CASE (FixGlbRejectsTruncatedFile)
 

Variables

static constexpr uint32_t GLB_MAGIC = 0x46546C67
 
static constexpr uint32_t GLB_CHUNK_JSON = 0x4E4F534A
 
static constexpr int GLTF_LINES_MODE = 1
 
static constexpr int GLTF_TRIANGLES_MODE = 4
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/8]

◆ BOOST_AUTO_TEST_CASE() [2/8]

BOOST_AUTO_TEST_CASE ( FixGlbBailsOnLoneSingleIndexLine )

Definition at line 334 of file test_glb_utils.cpp.

References FixGlbLinesPrimitives(), GLTF_LINES_MODE, path, and WriteTempGlb().

◆ BOOST_AUTO_TEST_CASE() [3/8]

◆ BOOST_AUTO_TEST_CASE() [4/8]

◆ BOOST_AUTO_TEST_CASE() [5/8]

◆ BOOST_AUTO_TEST_CASE() [6/8]

◆ BOOST_AUTO_TEST_CASE() [7/8]

BOOST_AUTO_TEST_CASE ( FixGlbRejectsTruncatedFile )

Definition at line 353 of file test_glb_utils.cpp.

References FixGlbLinesPrimitives(), GLTF_LINES_MODE, path, and WriteTempGlb().

◆ BOOST_AUTO_TEST_CASE() [8/8]

◆ GetTestGlbPath()

static wxString GetTestGlbPath ( const wxString & aFilename)
static

◆ ValidateGlbFile()

◆ WriteTempGlb()

static wxString WriteTempGlb ( const nlohmann::json & aGltf,
const wxString & aPrefix )
static

Variable Documentation

◆ GLB_CHUNK_JSON

uint32_t GLB_CHUNK_JSON = 0x4E4F534A
staticconstexpr

Definition at line 38 of file test_glb_utils.cpp.

◆ GLB_MAGIC

uint32_t GLB_MAGIC = 0x46546C67
staticconstexpr

Definition at line 37 of file test_glb_utils.cpp.

◆ GLTF_LINES_MODE

int GLTF_LINES_MODE = 1
staticconstexpr

Definition at line 39 of file test_glb_utils.cpp.

◆ GLTF_TRIANGLES_MODE

int GLTF_TRIANGLES_MODE = 4
staticconstexpr

Definition at line 40 of file test_glb_utils.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and ValidateGlbFile().