From 393f7ac000340f5736284bdff5927eac4622f801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josejulio=20Mart=C3=ADnez?= Date: Mon, 6 Nov 2023 13:48:46 -0700 Subject: [PATCH] Remove native-tests --- CMakeLists.txt | 18 ------------------ native_tests/CMakeLists.txt | 14 -------------- native_tests/bpay_rate_test.cpp | 28 ---------------------------- 3 files changed, 60 deletions(-) delete mode 100644 native_tests/CMakeLists.txt delete mode 100644 native_tests/bpay_rate_test.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 84c77e7d..22f34b78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,20 +43,6 @@ ExternalProject_Add( INSTALL_COMMAND "" BUILD_ALWAYS 1) -ExternalProject_Add( - nativetests - SOURCE_DIR ${CMAKE_SOURCE_DIR}/native_tests - BINARY_DIR ${CMAKE_BINARY_DIR}/native_tests - CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release - -DCMAKE_TOOLCHAIN_FILE=${CDT_ROOT}/lib/cmake/cdt/CDTWasmToolchain.cmake - -DSYSTEM_CONFIGURABLE_WASM_LIMITS=${SYSTEM_CONFIGURABLE_WASM_LIMITS} - -DSYSTEM_BLOCKCHAIN_PARAMETERS=${SYSTEM_BLOCKCHAIN_PARAMETERS} - UPDATE_COMMAND "" - PATCH_COMMAND "" - TEST_COMMAND "" - INSTALL_COMMAND "" - BUILD_ALWAYS 1 -) if(APPLE) set(OPENSSL_ROOT "/usr/local/opt/openssl") @@ -79,7 +65,3 @@ if(BUILD_TESTS) else() message(STATUS "Unit tests will not be built. To build unit tests, set BUILD_TESTS to ON.") endif() - -include (CTest) -enable_testing() -add_test(native_tests ${CMAKE_BINARY_DIR}/native_tests/bpay_rate_test) diff --git a/native_tests/CMakeLists.txt b/native_tests/CMakeLists.txt deleted file mode 100644 index 47ac3bb0..00000000 --- a/native_tests/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.5) - -project(native_tests) - -find_package(cdt) - -add_native_executable( - bpay_rate_test - bpay_rate_test - ${CMAKE_CURRENT_SOURCE_DIR}/bpay_rate_test.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../contracts/eosio.system/src/bpay_rate.cpp -) - -target_include_directories( bpay_rate_test PUBLIC ${CMAKE_SOURCE_DIR}/../contracts/eosio.system/include ) diff --git a/native_tests/bpay_rate_test.cpp b/native_tests/bpay_rate_test.cpp deleted file mode 100644 index 25740d03..00000000 --- a/native_tests/bpay_rate_test.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#undef NDEBUG -#include -#include -#include -#include - -using eosiosystem::compute_bpay_rate; - -void test_bpay_tests() { - eosio::asset TLOS_TOTAL_SUPPLY = eosio::asset( - 4200000000000, - eosio::symbol("TLOS", 4) - ); - - assert(compute_bpay_rate(2, TLOS_TOTAL_SUPPLY) == 8250); - assert(compute_bpay_rate(100, TLOS_TOTAL_SUPPLY) == 1096); - assert(compute_bpay_rate(200, TLOS_TOTAL_SUPPLY) == 766); - assert(compute_bpay_rate(500, TLOS_TOTAL_SUPPLY) == 478); - assert(compute_bpay_rate(1000, TLOS_TOTAL_SUPPLY) == 334); - assert(compute_bpay_rate(5000, TLOS_TOTAL_SUPPLY) == 146); - assert(compute_bpay_rate(10000, TLOS_TOTAL_SUPPLY) == 102); -} - - -int main(int argc, char** argv) { - test_bpay_tests(); - return 0; -}