star-cad

Geometric operators for computer-aided design
git clone git://git.meso-star.fr/star-cad.git
Log | Files | Refs | README | LICENSE

commit 612044e770202a92fa1c9e6f04dfec0a6382d494
parent 5a2f84fcaac8c088920d7d1ee13c70bb0e73640f
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Wed, 28 Dec 2022 19:06:58 +0100

Remove meaningless test

Diffstat:
Mcmake/CMakeLists.txt | 1-
Dsrc/test1.c | 92-------------------------------------------------------------------------------
2 files changed, 0 insertions(+), 93 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -91,7 +91,6 @@ if(NOT NO_TEST) register_test(${_name} ${_name}) endfunction() - new_test(test1) new_test(test_api) new_test(test_export) new_test(test_partition) diff --git a/src/test1.c b/src/test1.c @@ -1,92 +0,0 @@ -/* Copyright (C) 2022 |Meso|Star> (contact@meso-star.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#include "scad.h" -#include "scad_geometry.h" -#include "test_common.h" - -#include <rsys/rsys.h> -#include <rsys/math.h> -#include <rsys/mem_allocator.h> - -#include <stdlib.h> - -int -main(int argc, char* argv[]) -{ - res_T res = RES_OK; - double p1[3] = {0, 0, 0}; - double p2[3] = {0.25, 0.25, 0.8}; - double d1[3] = {1, 1, 1}; - double d2[3] = {0.5, 0.5, 0.5}; - struct scad_geometry* geom1 = NULL; - struct scad_geometry* geom2 = NULL; - struct scad_geometry* cyl = NULL; - struct scad_geometry* tmp1 = NULL; - struct scad_geometry* f1 = NULL; - struct scad_geometry* f2 = NULL; - struct scad_geometry* sphere = NULL; - struct scad_geometry* geoms[2]; - struct scad_geometry* out_geoms[2]; - struct scad_geometry* tools[5]; - struct mem_allocator allocator; - - (void)argc; (void)argv; - - OK(mem_init_proxy_allocator(&allocator, &mem_default_allocator)); - - OK(scad_initialize(NULL, &allocator, 1)); - - OK(scad_add_cylinder("c1", p1, d1, 2, PI, &geom1)); - OK(scad_add_box("b1", p2, d2, &geom2)); - geoms[0] = geom1; - geoms[1] = geom2; - BAD(scad_geometries_partition(NULL, 0, 0, NULL)); - BAD(scad_geometries_partition(geoms, 2, 1, NULL)); - OK(scad_geometries_partition(geoms, 2, 1, out_geoms)); - OK(scad_geometry_delete(out_geoms[0])); - OK(scad_geometry_delete(out_geoms[1])); - - OK(scad_cut_geometries("cut_c1", &geom1, 1, & geom2, 1, &tmp1)); - - OK(scad_add_cylinder("cyl", p1, d1, 1, 2*PI, &cyl)); - - OK(scad_fuse_geometries("fused1", &geom1, 1, &cyl, 1, &f1)); - - OK(scad_add_sphere("s1", p1, 1, &sphere)); - OK(scad_fuse_geometries("fused2", &f1, 1, &sphere, 1, &f2)); - - tools[0] = geom2; - tools[1] = tmp1; - tools[2] = geom1; - tools[3] = f1; - BAD(scad_geometries_partition(tools, 4, 0, NULL)); - /* OK(scad_scene_mesh()); */ - - OK(scad_stl_export(geom1, NULL, 1)); - OK(scad_stl_export(geom2, NULL, 1)); - OK(scad_stl_export(cyl, NULL, 1)); - OK(scad_stl_export(sphere, NULL, 1)); - /* OK(scad_stl_export(f1, NULL, 1)); */ - /* OK(scad_stl_export(f2, NULL, 0)); */ - - OK(scad_finalize()); - - check_memory_allocator(&allocator); - mem_shutdown_proxy_allocator(&allocator); - CHK(mem_allocated_size() == 0); - - return (res == RES_OK) ? EXIT_SUCCESS : EXIT_FAILURE; -}