gmio/tests/test_stl_infos.c

47 lines
1.5 KiB
C
Raw Normal View History

2015-03-03 00:38:33 +08:00
/****************************************************************************
2015-05-28 15:40:24 +08:00
** gmio
2015-05-01 00:19:45 +08:00
** Copyright Fougue (2 Mar. 2015)
2015-07-13 17:42:03 +08:00
** contact@fougue.pro
2015-03-03 00:38:33 +08:00
**
** This software is a reusable library whose purpose is to provide complete
** I/O support for various CAD file formats (eg. STL)
**
** This software is governed by the CeCILL-B license under French law and
** abiding by the rules of distribution of free software. You can use,
** modify and/ or redistribute the software under the terms of the CeCILL-B
** license as circulated by CEA, CNRS and INRIA at the following URL
2015-03-30 15:05:25 +08:00
** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
2015-03-03 00:38:33 +08:00
****************************************************************************/
#include "utest_assert.h"
2015-12-10 01:51:03 +08:00
#include "../src/gmio_core/error.h"
#include "../src/gmio_stl/stl_infos.h"
#include <stdio.h>
static const char stl_jburkardt_sphere_filepath[] =
"models/solid_jburkardt_sphere.stla";
2015-12-10 01:51:03 +08:00
const char* test_stl_infos()
2013-03-06 18:49:53 +08:00
{
FILE* stla_file = fopen(stl_jburkardt_sphere_filepath, "rb");
2015-12-10 01:51:03 +08:00
struct gmio_stl_infos_get_args args = {0};
int error = GMIO_ERROR_OK;
2015-12-10 01:51:03 +08:00
args.stream = gmio_stream_stdio(stla_file);
args.stream_memblock = gmio_memblock_malloc(8 * 1024); /* 8Ko */
2014-03-13 21:37:55 +08:00
error = gmio_stl_infos_get(
&args, GMIO_STL_FORMAT_ASCII, GMIO_STL_INFO_FLAG_ALL);
gmio_memblock_deallocate(&args.stream_memblock);
fclose(stla_file);
2015-12-10 01:51:03 +08:00
UTEST_ASSERT(error == GMIO_ERROR_OK);
/*UTEST_ASSERT(infos.facet_count == 228);*/
/*UTEST_ASSERT(stats.size == 54297);*/
2013-03-06 18:49:53 +08:00
return NULL;
}