2015-09-14 17:09:12 +08:00
|
|
|
/****************************************************************************
|
2017-01-27 01:05:12 +08:00
|
|
|
** Copyright (c) 2017, Fougue Ltd. <http://www.fougue.pro>
|
2016-07-05 18:46:22 +08:00
|
|
|
** All rights reserved.
|
2015-09-14 17:09:12 +08:00
|
|
|
**
|
2016-07-05 18:46:22 +08:00
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
2015-09-14 17:09:12 +08:00
|
|
|
**
|
2016-07-05 18:46:22 +08:00
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
**
|
|
|
|
** 2. Redistributions in binary form must reproduce the above
|
|
|
|
** copyright notice, this list of conditions and the following
|
|
|
|
** disclaimer in the documentation and/or other materials provided
|
|
|
|
** with the distribution.
|
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2015-09-14 17:09:12 +08:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "utest_lib.h"
|
|
|
|
|
2016-02-24 23:43:40 +08:00
|
|
|
#include "../src/gmio_core/memblock.h"
|
|
|
|
|
2016-06-16 16:29:27 +08:00
|
|
|
#include "test_stl_infos.c"
|
|
|
|
#include "test_stl_internal.c"
|
|
|
|
#include "test_stl_io.c"
|
|
|
|
#include "test_stl_triangle.c"
|
|
|
|
#include "test_stlb_header.c"
|
2016-02-24 23:43:40 +08:00
|
|
|
|
|
|
|
/* Static memblock */
|
|
|
|
struct gmio_memblock gmio_memblock_for_tests()
|
|
|
|
{
|
|
|
|
static uint8_t buff[1024]; /* 1KB */
|
|
|
|
return gmio_memblock(buff, sizeof(buff), NULL);
|
|
|
|
}
|
|
|
|
|
2015-09-14 17:09:12 +08:00
|
|
|
const char* all_tests()
|
|
|
|
{
|
|
|
|
UTEST_SUITE_START();
|
|
|
|
|
2016-02-24 23:43:40 +08:00
|
|
|
gmio_memblock_set_default_constructor(gmio_memblock_for_tests);
|
|
|
|
|
2016-09-29 22:26:23 +08:00
|
|
|
#if 0
|
|
|
|
generate_stlb_tests_models();
|
|
|
|
#endif
|
|
|
|
|
2016-02-05 19:20:14 +08:00
|
|
|
UTEST_RUN(test_stl_coords_packing);
|
|
|
|
UTEST_RUN(test_stl_triangle_packing);
|
|
|
|
UTEST_RUN(test_stl_triangle_compute_normal);
|
|
|
|
|
2016-10-27 23:42:24 +08:00
|
|
|
UTEST_RUN(test_stl_internal__error_check);
|
2015-09-14 17:10:19 +08:00
|
|
|
|
2015-12-10 01:51:03 +08:00
|
|
|
UTEST_RUN(test_stl_infos);
|
2016-02-05 19:20:14 +08:00
|
|
|
|
2015-09-14 17:09:12 +08:00
|
|
|
UTEST_RUN(test_stl_read);
|
2016-02-24 23:43:40 +08:00
|
|
|
UTEST_RUN(test_stl_read_multi_solid);
|
2016-07-05 17:28:44 +08:00
|
|
|
UTEST_RUN(test_stla_lc_numeric);
|
2015-12-10 01:51:03 +08:00
|
|
|
UTEST_RUN(test_stla_write);
|
2016-03-10 22:39:06 +08:00
|
|
|
UTEST_RUN(test_stlb_read);
|
2015-09-14 17:09:12 +08:00
|
|
|
UTEST_RUN(test_stlb_write);
|
2016-03-11 19:43:30 +08:00
|
|
|
UTEST_RUN(test_stlb_header_write);
|
2016-02-05 19:20:14 +08:00
|
|
|
|
2016-01-26 18:50:29 +08:00
|
|
|
UTEST_RUN(test_stlb_header_str);
|
|
|
|
UTEST_RUN(test_stlb_header_to_printable_str);
|
2015-09-14 17:09:12 +08:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
UTEST_MAIN(all_tests)
|