[Bf-blender-cvs] [c0fd3b6962e] functions: remove tests because their are more trouble than they are worth currently
Jacques Lucke
noreply at git.blender.org
Wed Jul 24 19:12:06 CEST 2019
Commit: c0fd3b6962ed7c651c3dbe4d0bf514fc090347f1
Author: Jacques Lucke
Date: Wed Jul 24 16:14:50 2019 +0200
Branches: functions
https://developer.blender.org/rBc0fd3b6962ed7c651c3dbe4d0bf514fc090347f1
remove tests because their are more trouble than they are worth currently
===================================================================
M tests/gtests/CMakeLists.txt
D tests/gtests/functions/CMakeLists.txt
D tests/gtests/functions/functions_test.cc
===================================================================
diff --git a/tests/gtests/CMakeLists.txt b/tests/gtests/CMakeLists.txt
index 0371062f254..142ff59e341 100644
--- a/tests/gtests/CMakeLists.txt
+++ b/tests/gtests/CMakeLists.txt
@@ -15,7 +15,6 @@ if(WITH_GTESTS)
add_subdirectory(blenlib)
add_subdirectory(guardedalloc)
#add_subdirectory(bmesh)
- add_subdirectory(functions)
if(WITH_ALEMBIC)
add_subdirectory(alembic)
endif()
diff --git a/tests/gtests/functions/CMakeLists.txt b/tests/gtests/functions/CMakeLists.txt
deleted file mode 100644
index 81df84370fe..00000000000
--- a/tests/gtests/functions/CMakeLists.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# 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 2
-# 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, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2019, Blender Foundation
-# All rights reserved.
-# ***** END GPL LICENSE BLOCK *****
-
-set(INC
- .
- ..
- ../../../source/blender/blenlib
- ../../../source/blender/blenkernel
- ../../../source/blender/makesrna
- ../../../source/blender/functions
- ../../../source/blender/makesdna
- ../../../intern/guardedalloc
- ${LLVM_INCLUDE_DIRS}
-)
-
-set(LIB
- bf_functions
-)
-
-include_directories(${INC})
-
-setup_libdirs()
-
-BLENDER_SRC_GTEST(functions "functions_test.cc" "${LIB}")
-
-
-setup_liblinks(functions_test)
diff --git a/tests/gtests/functions/functions_test.cc b/tests/gtests/functions/functions_test.cc
deleted file mode 100644
index 2948e9846a8..00000000000
--- a/tests/gtests/functions/functions_test.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "testing/testing.h"
-#include "FN_all.hpp"
-
-using namespace FN;
-
-#define PREPARE_TUPLE_CALL_TEST(FN) \
- auto *body = FN->body<TupleCallBody>(); \
- FN_TUPLE_CALL_ALLOC_TUPLES(body, fn_in, fn_out);
-
-class functions_impl : public testing::Test {
- protected:
- void SetUp() override
- {
- FN_initialize();
- }
-};
-
-TEST_F(functions_impl, MultiplyFloats)
-{
- PREPARE_TUPLE_CALL_TEST(Functions::GET_FN_multiply_floats());
-
- fn_in.set<float>(0, 4);
- fn_in.set<float>(1, 20);
-
- body->call__setup_execution_context(fn_in, fn_out);
-
- EXPECT_EQ(fn_out.get<float>(0), 80);
-}
-
-TEST_F(functions_impl, FloatRange)
-{
- PREPARE_TUPLE_CALL_TEST(Functions::GET_FN_float_range());
-
- fn_in.set<int>(0, 4);
- fn_in.set<float>(1, 2);
- fn_in.set<float>(2, 7);
-
- body->call__setup_execution_context(fn_in, fn_out);
-
- auto list = fn_out.relocate_out<Types::SharedFloatList>(0);
- EXPECT_EQ(list->size(), 4);
-
- float *ptr = list->data_ptr();
- EXPECT_EQ(ptr[0], 2);
- EXPECT_EQ(ptr[1], 9);
- EXPECT_EQ(ptr[2], 16);
- EXPECT_EQ(ptr[3], 23);
-}
-
-TEST_F(functions_impl, AddFloats)
-{
- auto fn = Functions::GET_FN_add_floats();
- derive_TupleCallBody_from_LLVMBuildIRBody(fn);
- PREPARE_TUPLE_CALL_TEST(fn);
-
- fn_in.set<float>(0, 3.5f);
- fn_in.set<float>(1, 1.5f);
-
- body->call__setup_execution_context(fn_in, fn_out);
-
- EXPECT_EQ(fn_out.get<float>(0), 5.0f);
-}
More information about the Bf-blender-cvs
mailing list