mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
* Adjustment: Update Assimp version to 5.0.1.
This commit is contained in:
parent
14ebeaf3eb
commit
4758f7bdaf
679 changed files with 50502 additions and 19698 deletions
|
|
@ -1,11 +1,19 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
|
||||
if(ENABLE_COVERAGE)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g ")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
# test
|
||||
set(test_out test.out)
|
||||
include_directories(../src)
|
||||
add_executable(test.exe test.c ../src/zip.c)
|
||||
add_executable(test_miniz.exe test_miniz.c)
|
||||
|
||||
add_executable(${test_out} test.c)
|
||||
target_link_libraries(${test_out} zip)
|
||||
|
||||
add_test(NAME ${test_out} COMMAND ${test_out})
|
||||
|
||||
set(test_out ${test_out} PARENT_SCOPE)
|
||||
add_test(NAME test COMMAND test.exe)
|
||||
add_test(NAME test_miniz COMMAND test_miniz.exe)
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@
|
|||
#define XFILE "7.txt\0"
|
||||
#define XMODE 0100777
|
||||
|
||||
#define UNIXMODE 0100644
|
||||
|
||||
#define UNUSED(x) (void)x
|
||||
|
||||
static int total_entries = 0;
|
||||
|
|
@ -47,7 +45,7 @@ static void test_write(void) {
|
|||
assert(CRC32DATA1 == zip_entry_crc32(zip));
|
||||
++total_entries;
|
||||
assert(0 == zip_entry_close(zip));
|
||||
assert(0 == zip_is64(zip));
|
||||
|
||||
zip_close(zip);
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +90,6 @@ static void test_read(void) {
|
|||
size_t buftmp;
|
||||
struct zip_t *zip = zip_open(ZIPNAME, 0, 'r');
|
||||
assert(zip != NULL);
|
||||
assert(0 == zip_is64(zip));
|
||||
|
||||
assert(0 == zip_entry_open(zip, "test\\test-1.txt"));
|
||||
assert(strlen(TESTDATA1) == zip_entry_size(zip));
|
||||
|
|
@ -105,8 +102,7 @@ static void test_read(void) {
|
|||
assert(0 == zip_entry_close(zip));
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
bufsize = 0;
|
||||
|
||||
|
||||
assert(0 == zip_entry_open(zip, "test/test-2.txt"));
|
||||
assert(strlen(TESTDATA2) == zip_entry_size(zip));
|
||||
assert(CRC32DATA2 == zip_entry_crc32(zip));
|
||||
|
|
@ -135,8 +131,7 @@ static void test_read(void) {
|
|||
assert(0 == zip_entry_close(zip));
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
bufsize = 0;
|
||||
|
||||
|
||||
buftmp = strlen(TESTDATA1);
|
||||
buf = calloc(buftmp, sizeof(char));
|
||||
assert(0 == zip_entry_open(zip, "test/test-1.txt"));
|
||||
|
|
@ -311,7 +306,6 @@ static void test_fwrite(void) {
|
|||
assert(0 == zip_entry_open(zip, WFILE));
|
||||
assert(0 == zip_entry_fwrite(zip, WFILE));
|
||||
assert(0 == zip_entry_close(zip));
|
||||
assert(0 == zip_is64(zip));
|
||||
|
||||
zip_close(zip);
|
||||
remove(WFILE);
|
||||
|
|
@ -439,35 +433,6 @@ static void test_mtime(void) {
|
|||
remove(ZIPNAME);
|
||||
}
|
||||
|
||||
static void test_unix_permissions(void) {
|
||||
#if defined(_WIN64) || defined(_WIN32) || defined(__WIN32__)
|
||||
#else
|
||||
// UNIX or APPLE
|
||||
struct MZ_FILE_STAT_STRUCT file_stats;
|
||||
|
||||
remove(ZIPNAME);
|
||||
|
||||
struct zip_t *zip = zip_open(ZIPNAME, ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');
|
||||
assert(zip != NULL);
|
||||
|
||||
assert(0 == zip_entry_open(zip, RFILE));
|
||||
assert(0 == zip_entry_write(zip, TESTDATA1, strlen(TESTDATA1)));
|
||||
assert(0 == zip_entry_close(zip));
|
||||
|
||||
zip_close(zip);
|
||||
|
||||
remove(RFILE);
|
||||
|
||||
assert(0 == zip_extract(ZIPNAME, ".", NULL, NULL));
|
||||
|
||||
assert(0 == MZ_FILE_STAT(RFILE, &file_stats));
|
||||
assert(UNIXMODE == file_stats.st_mode);
|
||||
|
||||
remove(RFILE);
|
||||
remove(ZIPNAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
UNUSED(argc);
|
||||
UNUSED(argv);
|
||||
|
|
@ -488,7 +453,6 @@ int main(int argc, char *argv[]) {
|
|||
test_write_permissions();
|
||||
test_exe_permissions();
|
||||
test_mtime();
|
||||
test_unix_permissions();
|
||||
|
||||
remove(ZIPNAME);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -23,39 +23,16 @@ int main(int argc, char *argv[]) {
|
|||
uint step = 0;
|
||||
int cmp_status;
|
||||
uLong src_len = (uLong)strlen(s_pStr);
|
||||
uLong cmp_len = compressBound(src_len);
|
||||
uLong uncomp_len = src_len;
|
||||
uLong cmp_len;
|
||||
uint8 *pCmp, *pUncomp;
|
||||
size_t sz;
|
||||
uint total_succeeded = 0;
|
||||
(void)argc, (void)argv;
|
||||
|
||||
printf("miniz.c version: %s\n", MZ_VERSION);
|
||||
|
||||
do {
|
||||
pCmp = (uint8 *)tdefl_compress_mem_to_heap(s_pStr, src_len, &cmp_len, 0);
|
||||
if (!pCmp) {
|
||||
printf("tdefl_compress_mem_to_heap failed\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (src_len <= cmp_len) {
|
||||
printf("tdefl_compress_mem_to_heap failed: from %u to %u bytes\n",
|
||||
(mz_uint32)uncomp_len, (mz_uint32)cmp_len);
|
||||
free(pCmp);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
sz = tdefl_compress_mem_to_mem(pCmp, cmp_len, s_pStr, src_len, 0);
|
||||
if (sz != cmp_len) {
|
||||
printf("tdefl_compress_mem_to_mem failed: expected %u, got %u\n",
|
||||
(mz_uint32)cmp_len, (mz_uint32)sz);
|
||||
free(pCmp);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Allocate buffers to hold compressed and uncompressed data.
|
||||
free(pCmp);
|
||||
cmp_len = compressBound(src_len);
|
||||
pCmp = (mz_uint8 *)malloc((size_t)cmp_len);
|
||||
pUncomp = (mz_uint8 *)malloc((size_t)src_len);
|
||||
if ((!pCmp) || (!pUncomp)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue