Files
ViewDesignEngine/tests/test_utils.h
T
hm a303114ef6 VDE-584~588: Feedback from ViewDesign Batch 254-258 panels
- VDE-584: Structural FEA mesh gen - Delaunay 3D tetrahedral meshing + quality optimization + CAE format export (Abaqus/Ansys/Nastran)

- VDE-585: FeatureWorks face extraction - mesh face clustering by normal direction, face type classification (planar/cylindrical/conical/toroidal)

- VDE-586: FeatureWorks measurement - mass properties (volume/centroid/inertia), surface area, bounding box from Shape geometry

- VDE-587: Python Shape module - pybind11 bindings for Shape creation, boolean ops, measurement, serialization to JSON

- VDE-588: PDM Shape validation - mesh validity check, watertightness, closed manifold detection, file stats from Shape
2026-08-07 15:39:39 +08:00

37 lines
786 B
C++

#pragma once
/**
* @file test_utils.h
* @brief Cross-platform test utilities
*/
#include <string>
#include <cstdlib>
#include <cstdio>
#include <vector>
namespace vde::test {
/**
* @brief Get a platform-appropriate temporary directory path
*/
inline std::string temp_dir() {
#ifdef _WIN32
const char* tmp = std::getenv("TEMP");
if (!tmp) tmp = std::getenv("TMP");
if (!tmp) tmp = "C:\\Temp";
return std::string(tmp) + "\\";
#else
return "/tmp/";
#endif
}
/**
* @brief Generate a unique temporary file path with the given prefix and extension
*/
inline std::string temp_file(const std::string& prefix, const std::string& ext) {
static int counter = 0;
return temp_dir() + prefix + "_" + std::to_string(counter++) + ext;
}
} // namespace vde::test