From df84537e5a6eefae9d9f390eec9a95a63d5494ca Mon Sep 17 00:00:00 2001 From: Hiroki Gondo Date: Fri, 17 Aug 2018 13:19:43 +0900 Subject: [PATCH] refactor gtests and add make test --- .gitignore | 1 + .travis.yml | 2 ++ Makefile | 5 +++++ {ptarm/gtests/gtest => gtest}/Makefile | 0 {ptarm/gtests/gtest => gtest}/gtest-all.cc | 0 {ptarm/gtests/gtest => gtest}/gtest-main.cc | 2 +- {ptarm/gtests/gtest => gtest}/gtest.h | 0 ptarm/Makefile | 5 +++++ ptarm/ptarm.h | 2 ++ ptarm/ptarm_util.c | 4 ++++ ptarm/{gtests => tests}/Makefile | 14 ++++++++------ ptarm/{gtests => tests}/_testinc_template.cpp | 1 + ptarm/{gtests => tests}/fakeinc.cpp | 0 ptarm/{gtests => tests}/fff.h | 0 ptarm/{gtests => tests}/test_ptarm.cpp | 3 +++ ptarm/{gtests => tests}/testinc_bech32.cpp | 1 + ptarm/{gtests => tests}/testinc_buf.cpp | 1 + ptarm/{gtests => tests}/testinc_ekey.cpp | 2 ++ ptarm/{gtests => tests}/testinc_hash.cpp | 0 ptarm/{gtests => tests}/testinc_keys.cpp | 1 + ptarm/{gtests => tests}/testinc_keys_native.cpp | 1 + ptarm/{gtests => tests}/testinc_ln.cpp | 1 + ptarm/{gtests => tests}/testinc_ln_bolt3_b.cpp | 1 + ptarm/{gtests => tests}/testinc_ln_bolt3_c.cpp | 1 + ptarm/{gtests => tests}/testinc_ln_bolt3_d.cpp | 1 + ptarm/{gtests => tests}/testinc_ln_bolt3_e.cpp | 1 + ptarm/{gtests => tests}/testinc_ln_bolt4.cpp | 1 + ptarm/{gtests => tests}/testinc_ln_bolt8.cpp | 1 + ptarm/{gtests => tests}/testinc_ln_misc.cpp | 1 + ptarm/{gtests => tests}/testinc_push.cpp | 1 + ptarm/{gtests => tests}/testinc_recoverpub.cpp | 1 + ptarm/{gtests => tests}/testinc_segwit.cpp | 1 + ptarm/{gtests => tests}/testinc_send.cpp | 1 + ptarm/{gtests => tests}/testinc_sw_native.cpp | 1 + ptarm/{gtests => tests}/testinc_tx.cpp | 1 + ptarm/{gtests => tests}/testinc_tx_native.cpp | 1 + 36 files changed, 53 insertions(+), 7 deletions(-) rename {ptarm/gtests/gtest => gtest}/Makefile (100%) rename {ptarm/gtests/gtest => gtest}/gtest-all.cc (100%) rename {ptarm/gtests/gtest => gtest}/gtest-main.cc (80%) rename {ptarm/gtests/gtest => gtest}/gtest.h (100%) rename ptarm/{gtests => tests}/Makefile (91%) rename ptarm/{gtests => tests}/_testinc_template.cpp (95%) rename ptarm/{gtests => tests}/fakeinc.cpp (100%) rename ptarm/{gtests => tests}/fff.h (100%) rename ptarm/{gtests => tests}/test_ptarm.cpp (96%) rename ptarm/{gtests => tests}/testinc_bech32.cpp (99%) rename ptarm/{gtests => tests}/testinc_buf.cpp (97%) rename ptarm/{gtests => tests}/testinc_ekey.cpp (99%) rename ptarm/{gtests => tests}/testinc_hash.cpp (100%) rename ptarm/{gtests => tests}/testinc_keys.cpp (99%) rename ptarm/{gtests => tests}/testinc_keys_native.cpp (95%) rename ptarm/{gtests => tests}/testinc_ln.cpp (95%) rename ptarm/{gtests => tests}/testinc_ln_bolt3_b.cpp (99%) rename ptarm/{gtests => tests}/testinc_ln_bolt3_c.cpp (99%) rename ptarm/{gtests => tests}/testinc_ln_bolt3_d.cpp (99%) rename ptarm/{gtests => tests}/testinc_ln_bolt3_e.cpp (99%) rename ptarm/{gtests => tests}/testinc_ln_bolt4.cpp (99%) rename ptarm/{gtests => tests}/testinc_ln_bolt8.cpp (99%) rename ptarm/{gtests => tests}/testinc_ln_misc.cpp (99%) rename ptarm/{gtests => tests}/testinc_push.cpp (99%) rename ptarm/{gtests => tests}/testinc_recoverpub.cpp (98%) rename ptarm/{gtests => tests}/testinc_segwit.cpp (97%) rename ptarm/{gtests => tests}/testinc_send.cpp (99%) rename ptarm/{gtests => tests}/testinc_sw_native.cpp (98%) rename ptarm/{gtests => tests}/testinc_tx.cpp (99%) rename ptarm/{gtests => tests}/testinc_tx_native.cpp (98%) diff --git a/.gitignore b/.gitignore index 0c2ddf8a0..a78f05e62 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ routing/routing .Depend *.o +*.a *.log GPATH GRTAGS diff --git a/.travis.yml b/.travis.yml index b90f38322..3c5e0866c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,3 +34,5 @@ addons: script: - make full + - make test + diff --git a/Makefile b/Makefile index 8a65b6aef..507772443 100644 --- a/Makefile +++ b/Makefile @@ -42,3 +42,8 @@ lib_clean: git_subs: git submodule update --init --recursive + +test: + $(MAKE) -C gtest + $(MAKE) -C ptarm test + diff --git a/ptarm/gtests/gtest/Makefile b/gtest/Makefile similarity index 100% rename from ptarm/gtests/gtest/Makefile rename to gtest/Makefile diff --git a/ptarm/gtests/gtest/gtest-all.cc b/gtest/gtest-all.cc similarity index 100% rename from ptarm/gtests/gtest/gtest-all.cc rename to gtest/gtest-all.cc diff --git a/ptarm/gtests/gtest/gtest-main.cc b/gtest/gtest-main.cc similarity index 80% rename from ptarm/gtests/gtest/gtest-main.cc rename to gtest/gtest-main.cc index 4f5bbb280..4483c91af 100644 --- a/ptarm/gtests/gtest/gtest-main.cc +++ b/gtest/gtest-main.cc @@ -1,4 +1,4 @@ -#include "gtest.h" +#include "gtest/gtest.h" int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); diff --git a/ptarm/gtests/gtest/gtest.h b/gtest/gtest.h similarity index 100% rename from ptarm/gtests/gtest/gtest.h rename to gtest/gtest.h diff --git a/ptarm/Makefile b/ptarm/Makefile index 6d3786713..a1b0d5a04 100644 --- a/ptarm/Makefile +++ b/ptarm/Makefile @@ -213,6 +213,11 @@ cppcheck: clean: $(RM) $(OBJECT_DIRECTORY) $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME) .Depend + $(MAKE) -C tests clean + +test: + $(MAKE) -C tests + $(MAKE) -C tests exec ################################ diff --git a/ptarm/ptarm.h b/ptarm/ptarm.h index 143fa53b2..7e91e42b9 100644 --- a/ptarm/ptarm.h +++ b/ptarm/ptarm.h @@ -1424,6 +1424,8 @@ void ptarm_print_extendedkey(const ptarm_ekey_t *pEKey); * @return malloc残数 */ int ptarm_dbg_malloc_cnt(void); + +void ptarm_dbg_malloc_cnt_reset(void); #endif //PTARM_DEBUG_MEM #ifdef __cplusplus diff --git a/ptarm/ptarm_util.c b/ptarm/ptarm_util.c index ab7e60195..38b4bf04b 100644 --- a/ptarm/ptarm_util.c +++ b/ptarm/ptarm_util.c @@ -399,6 +399,10 @@ int ptarm_dbg_malloc_cnt(void) return mcount; } +void ptarm_dbg_malloc_cnt_reset(void) +{ + mcount = 0; +} #endif //PTARM_DEBUG_MEM diff --git a/ptarm/gtests/Makefile b/ptarm/tests/Makefile similarity index 91% rename from ptarm/gtests/Makefile rename to ptarm/tests/Makefile index 80bb064ff..95503541f 100644 --- a/ptarm/gtests/Makefile +++ b/ptarm/tests/Makefile @@ -1,4 +1,4 @@ -GTEST_DIR = ./gtest +GTEST_DIR = ../../gtest OBJECT_DIRECTORY = _ggtest CXX=g++ @@ -15,7 +15,7 @@ TEST_TARGET_SRC += test_ptarm.cpp # Flags passed to the preprocessor. # Set Google Test's header directory as a system directory, such that # the compiler doesn't generate warnings in Google Test headers. -CPPFLAGS += -isystem -I$(GTEST_DIR) -DUNITTEST -D_GLIBCXX_USE_CXX11_ABI=1 +CPPFLAGS += -isystem $(GTEST_DIR)/.. -DUNITTEST -D_GLIBCXX_USE_CXX11_ABI=1 CPPFLAGS += -DNDEBUG CPPFLAGS += -DPTARM_DEBUG CPPFLAGS += -DPTARM_DEBUG_MEM @@ -44,7 +44,7 @@ vpath %.cpp $(TEST_PATHS) all: .Depend unittest -unittest : $(OBJECT_DIRECTORY) $(GTEST_DIR)/gtest_main.a $(TEST_OBJECTS) +unittest: $(OBJECT_DIRECTORY) $(GTEST_DIR)/gtest_main.a $(TEST_OBJECTS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(TEST_OBJECTS) $(GTEST_DIR)/gtest_main.a -o $(OBJECT_DIRECTORY)/$@ $(LDFLAGS) $(OBJECT_DIRECTORY): @@ -62,15 +62,17 @@ $(GTEST_DIR)/gtest_main.a: make -C $(GTEST_DIR) .Depend: +ifneq ($(MAKECMDGOALS),clean) $(foreach SRC,$(TEST_TARGET_SRC),$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MM -MT $(OBJECT_DIRECTORY)/$(SRC:.cpp=.o) $(SRC) >> .Depend;) +endif -rmlcov : +rmlcov: $(RM) $(OBJECT_DIRECTORY)/*.gcda -clean : +clean: @$(RM) $(OBJECT_DIRECTORY) .Depend -clobber : clean +clobber: clean make -C $(GTEST_DIR) clean exec: rmlcov diff --git a/ptarm/gtests/_testinc_template.cpp b/ptarm/tests/_testinc_template.cpp similarity index 95% rename from ptarm/gtests/_testinc_template.cpp rename to ptarm/tests/_testinc_template.cpp index 3727910b3..bdfd51f09 100644 --- a/ptarm/gtests/_testinc_template.cpp +++ b/ptarm/tests/_testinc_template.cpp @@ -9,6 +9,7 @@ class xxx: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/fakeinc.cpp b/ptarm/tests/fakeinc.cpp similarity index 100% rename from ptarm/gtests/fakeinc.cpp rename to ptarm/tests/fakeinc.cpp diff --git a/ptarm/gtests/fff.h b/ptarm/tests/fff.h similarity index 100% rename from ptarm/gtests/fff.h rename to ptarm/tests/fff.h diff --git a/ptarm/gtests/test_ptarm.cpp b/ptarm/tests/test_ptarm.cpp similarity index 96% rename from ptarm/gtests/test_ptarm.cpp rename to ptarm/tests/test_ptarm.cpp index 7740a1227..e4d99d738 100644 --- a/ptarm/gtests/test_ptarm.cpp +++ b/ptarm/tests/test_ptarm.cpp @@ -50,6 +50,7 @@ TEST_F(ptarm, first) TEST_F(ptarm, ptarm_setnet_testnet_false) { + ptarm_dbg_malloc_cnt_reset(); bool ret = ptarm_init(PTARM_TESTNET, false); ASSERT_TRUE(ret); ASSERT_EQ(2, mPref[PTARM_PREF]); @@ -63,6 +64,7 @@ TEST_F(ptarm, ptarm_setnet_testnet_false) TEST_F(ptarm, ptarm_setnet_testnet_true) { + ptarm_dbg_malloc_cnt_reset(); bool ret = ptarm_init(PTARM_TESTNET, true); ASSERT_TRUE(ret); ASSERT_EQ(2, mPref[PTARM_PREF]); @@ -76,6 +78,7 @@ TEST_F(ptarm, ptarm_setnet_testnet_true) TEST_F(ptarm, ptarm_setnet_mainnet) { + ptarm_dbg_malloc_cnt_reset(); bool ret = ptarm_init(PTARM_MAINNET, false); ASSERT_TRUE(ret); ASSERT_EQ(1, mPref[PTARM_PREF]); diff --git a/ptarm/gtests/testinc_bech32.cpp b/ptarm/tests/testinc_bech32.cpp similarity index 99% rename from ptarm/gtests/testinc_bech32.cpp rename to ptarm/tests/testinc_bech32.cpp index cf9400099..0ede73655 100644 --- a/ptarm/gtests/testinc_bech32.cpp +++ b/ptarm/tests/testinc_bech32.cpp @@ -9,6 +9,7 @@ class bech32: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_buf.cpp b/ptarm/tests/testinc_buf.cpp similarity index 97% rename from ptarm/gtests/testinc_buf.cpp rename to ptarm/tests/testinc_buf.cpp index 2252c5e98..231b35a6f 100644 --- a/ptarm/gtests/testinc_buf.cpp +++ b/ptarm/tests/testinc_buf.cpp @@ -9,6 +9,7 @@ class buf: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_ekey.cpp b/ptarm/tests/testinc_ekey.cpp similarity index 99% rename from ptarm/gtests/testinc_ekey.cpp rename to ptarm/tests/testinc_ekey.cpp index 229c4b402..bee1ee66c 100644 --- a/ptarm/gtests/testinc_ekey.cpp +++ b/ptarm/tests/testinc_ekey.cpp @@ -9,6 +9,7 @@ class extendedkey: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_MAINNET, false); } @@ -501,6 +502,7 @@ TEST_F(extendedkey, chain_m_master2) TEST_F(extendedkey, chain_testnet) { + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); uint8_t buf_ekey[PTARM_SZ_EKEY]; diff --git a/ptarm/gtests/testinc_hash.cpp b/ptarm/tests/testinc_hash.cpp similarity index 100% rename from ptarm/gtests/testinc_hash.cpp rename to ptarm/tests/testinc_hash.cpp diff --git a/ptarm/gtests/testinc_keys.cpp b/ptarm/tests/testinc_keys.cpp similarity index 99% rename from ptarm/gtests/testinc_keys.cpp rename to ptarm/tests/testinc_keys.cpp index d9a2836a2..9b421e110 100644 --- a/ptarm/gtests/testinc_keys.cpp +++ b/ptarm/tests/testinc_keys.cpp @@ -9,6 +9,7 @@ class keys: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_keys_native.cpp b/ptarm/tests/testinc_keys_native.cpp similarity index 95% rename from ptarm/gtests/testinc_keys_native.cpp rename to ptarm/tests/testinc_keys_native.cpp index ace5d24fb..3c737aa6c 100644 --- a/ptarm/gtests/testinc_keys_native.cpp +++ b/ptarm/tests/testinc_keys_native.cpp @@ -9,6 +9,7 @@ class keys_native: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); } diff --git a/ptarm/gtests/testinc_ln.cpp b/ptarm/tests/testinc_ln.cpp similarity index 95% rename from ptarm/gtests/testinc_ln.cpp rename to ptarm/tests/testinc_ln.cpp index 7e0411528..05a6fbc37 100644 --- a/ptarm/gtests/testinc_ln.cpp +++ b/ptarm/tests/testinc_ln.cpp @@ -9,6 +9,7 @@ class ln: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); } diff --git a/ptarm/gtests/testinc_ln_bolt3_b.cpp b/ptarm/tests/testinc_ln_bolt3_b.cpp similarity index 99% rename from ptarm/gtests/testinc_ln_bolt3_b.cpp rename to ptarm/tests/testinc_ln_bolt3_b.cpp index 20d0efd25..795de4ddd 100644 --- a/ptarm/gtests/testinc_ln_bolt3_b.cpp +++ b/ptarm/tests/testinc_ln_bolt3_b.cpp @@ -42,6 +42,7 @@ ptarm_util_keys_t ln_bolt3_b::keys; TEST_F(ln_bolt3_b, fuding1) { + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); diff --git a/ptarm/gtests/testinc_ln_bolt3_c.cpp b/ptarm/tests/testinc_ln_bolt3_c.cpp similarity index 99% rename from ptarm/gtests/testinc_ln_bolt3_c.cpp rename to ptarm/tests/testinc_ln_bolt3_c.cpp index 77fb82826..987fa75dd 100644 --- a/ptarm/gtests/testinc_ln_bolt3_c.cpp +++ b/ptarm/tests/testinc_ln_bolt3_c.cpp @@ -264,6 +264,7 @@ ln_htlcinfo_t** ln_bolt3_c::pp_htlcinfos; TEST_F(ln_bolt3_c, start) { + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); } diff --git a/ptarm/gtests/testinc_ln_bolt3_d.cpp b/ptarm/tests/testinc_ln_bolt3_d.cpp similarity index 99% rename from ptarm/gtests/testinc_ln_bolt3_d.cpp rename to ptarm/tests/testinc_ln_bolt3_d.cpp index b0b9ba3e4..853f5088b 100644 --- a/ptarm/gtests/testinc_ln_bolt3_d.cpp +++ b/ptarm/tests/testinc_ln_bolt3_d.cpp @@ -14,6 +14,7 @@ class ln_bolt3_d: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); } diff --git a/ptarm/gtests/testinc_ln_bolt3_e.cpp b/ptarm/tests/testinc_ln_bolt3_e.cpp similarity index 99% rename from ptarm/gtests/testinc_ln_bolt3_e.cpp rename to ptarm/tests/testinc_ln_bolt3_e.cpp index d08d9ef4a..194c8dacc 100644 --- a/ptarm/gtests/testinc_ln_bolt3_e.cpp +++ b/ptarm/tests/testinc_ln_bolt3_e.cpp @@ -9,6 +9,7 @@ class ln_derkey: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); } diff --git a/ptarm/gtests/testinc_ln_bolt4.cpp b/ptarm/tests/testinc_ln_bolt4.cpp similarity index 99% rename from ptarm/gtests/testinc_ln_bolt4.cpp rename to ptarm/tests/testinc_ln_bolt4.cpp index 5ce8bf7f5..dca75157f 100644 --- a/ptarm/gtests/testinc_ln_bolt4.cpp +++ b/ptarm/tests/testinc_ln_bolt4.cpp @@ -17,6 +17,7 @@ class onion: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); ptarm_buf_init(&sOnionBuffer); spEphPubkey = NULL; diff --git a/ptarm/gtests/testinc_ln_bolt8.cpp b/ptarm/tests/testinc_ln_bolt8.cpp similarity index 99% rename from ptarm/gtests/testinc_ln_bolt8.cpp rename to ptarm/tests/testinc_ln_bolt8.cpp index b5c4b6f5e..15c775053 100644 --- a/ptarm/gtests/testinc_ln_bolt8.cpp +++ b/ptarm/tests/testinc_ln_bolt8.cpp @@ -9,6 +9,7 @@ class bolt8test: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); } diff --git a/ptarm/gtests/testinc_ln_misc.cpp b/ptarm/tests/testinc_ln_misc.cpp similarity index 99% rename from ptarm/gtests/testinc_ln_misc.cpp rename to ptarm/tests/testinc_ln_misc.cpp index 0d49f7e48..1d8b06ab7 100644 --- a/ptarm/gtests/testinc_ln_misc.cpp +++ b/ptarm/tests/testinc_ln_misc.cpp @@ -9,6 +9,7 @@ class misc: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_push.cpp b/ptarm/tests/testinc_push.cpp similarity index 99% rename from ptarm/gtests/testinc_push.cpp rename to ptarm/tests/testinc_push.cpp index bc069843e..c78469201 100644 --- a/ptarm/gtests/testinc_push.cpp +++ b/ptarm/tests/testinc_push.cpp @@ -9,6 +9,7 @@ class push: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_recoverpub.cpp b/ptarm/tests/testinc_recoverpub.cpp similarity index 98% rename from ptarm/gtests/testinc_recoverpub.cpp rename to ptarm/tests/testinc_recoverpub.cpp index 677c407b5..08fed6219 100644 --- a/ptarm/gtests/testinc_recoverpub.cpp +++ b/ptarm/tests/testinc_recoverpub.cpp @@ -9,6 +9,7 @@ class recoverpub: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_segwit.cpp b/ptarm/tests/testinc_segwit.cpp similarity index 97% rename from ptarm/gtests/testinc_segwit.cpp rename to ptarm/tests/testinc_segwit.cpp index 967b0f369..b671533ab 100644 --- a/ptarm/gtests/testinc_segwit.cpp +++ b/ptarm/tests/testinc_segwit.cpp @@ -9,6 +9,7 @@ class sw: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_send.cpp b/ptarm/tests/testinc_send.cpp similarity index 99% rename from ptarm/gtests/testinc_send.cpp rename to ptarm/tests/testinc_send.cpp index 759192c53..9b773f52c 100644 --- a/ptarm/gtests/testinc_send.cpp +++ b/ptarm/tests/testinc_send.cpp @@ -9,6 +9,7 @@ class send: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_sw_native.cpp b/ptarm/tests/testinc_sw_native.cpp similarity index 98% rename from ptarm/gtests/testinc_sw_native.cpp rename to ptarm/tests/testinc_sw_native.cpp index dc42ec7ac..57412ed29 100644 --- a/ptarm/gtests/testinc_sw_native.cpp +++ b/ptarm/tests/testinc_sw_native.cpp @@ -9,6 +9,7 @@ class sw_native: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); } diff --git a/ptarm/gtests/testinc_tx.cpp b/ptarm/tests/testinc_tx.cpp similarity index 99% rename from ptarm/gtests/testinc_tx.cpp rename to ptarm/tests/testinc_tx.cpp index ee46c50aa..b59e42d5c 100644 --- a/ptarm/gtests/testinc_tx.cpp +++ b/ptarm/tests/testinc_tx.cpp @@ -9,6 +9,7 @@ class tx: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, false); } diff --git a/ptarm/gtests/testinc_tx_native.cpp b/ptarm/tests/testinc_tx_native.cpp similarity index 98% rename from ptarm/gtests/testinc_tx_native.cpp rename to ptarm/tests/testinc_tx_native.cpp index 971427d88..3735b3350 100644 --- a/ptarm/gtests/testinc_tx_native.cpp +++ b/ptarm/tests/testinc_tx_native.cpp @@ -9,6 +9,7 @@ class tx_native: public testing::Test { protected: virtual void SetUp() { //RESET_FAKE(external_function) + ptarm_dbg_malloc_cnt_reset(); ptarm_init(PTARM_TESTNET, true); }