From 8946268f4351bceb4f19662b233a29482c9e56af Mon Sep 17 00:00:00 2001 From: cpockrandt Date: Mon, 17 Dec 2018 14:40:40 +0100 Subject: [PATCH] tmp commit --- .travis.yml | 20 +++++++++---------- include/sdsl/divsufsort.hpp | 2 +- include/sdsl/wt_algorithm.hpp | 2 +- test/search_bidirectional_test.cpp | 32 +++++++++++++++++++----------- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 187efcf0e..ef190f889 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ matrix: - cmake - g++-4.9 - - env: MYCC="gcc-5" MYCXX="g++-5" STDLIB=libstdc++ MYBUILD=Debug + - env: MYCC="gcc-5" MYCXX="g++-5" STDLIB=libstdc++ MYBUILD=Release os: linux addons: &gcc5 apt: @@ -43,38 +43,38 @@ matrix: - cmake - g++-5 - - env: MYCC="gcc-5" MYCXX="g++-5" STDLIB=libstdc++ MYBUILD=Release + - env: MYCC="gcc-6" MYCXX="g++-6" STDLIB=libstdc++ MYBUILD=Release os: linux - addons: &gcc5 + addons: &gcc6 apt: sources: - kalakris-cmake - ubuntu-toolchain-r-test packages: - cmake - - g++-5 + - g++-6 - - env: MYCC="gcc-6" MYCXX="g++-6" STDLIB=libstdc++ MYBUILD=Debug + - env: MYCC="gcc-7" MYCXX="g++-7" STDLIB=libstdc++ MYBUILD=Release os: linux - addons: &gcc6 + addons: &gcc7 apt: sources: - kalakris-cmake - ubuntu-toolchain-r-test packages: - cmake - - g++-6 + - g++-7 - - env: MYCC="gcc-6" MYCXX="g++-6" STDLIB=libstdc++ MYBUILD=Release + - env: MYCC="gcc-8" MYCXX="g++-8" STDLIB=libstdc++ MYBUILD=Release os: linux - addons: &gcc6 + addons: &gcc8 apt: sources: - kalakris-cmake - ubuntu-toolchain-r-test packages: - cmake - - g++-6 + - g++-8 - env: MYCC="clang" MYCXX="clang++" STDLIB=libc++ os: osx diff --git a/include/sdsl/divsufsort.hpp b/include/sdsl/divsufsort.hpp index ee4ac4052..b2444639e 100644 --- a/include/sdsl/divsufsort.hpp +++ b/include/sdsl/divsufsort.hpp @@ -1688,7 +1688,7 @@ divsufsort(const uint8_t *T, saidx_t *SA, saidx_t n) { // } inline int32_t divsufsort64(const uint8_t *T, int64_t *SA, int64_t n) { - return divsufsort64(T, SA, n); + return divsufsort(T, SA, n); } template diff --git a/include/sdsl/wt_algorithm.hpp b/include/sdsl/wt_algorithm.hpp index 41bb9210b..4752c3037 100644 --- a/include/sdsl/wt_algorithm.hpp +++ b/include/sdsl/wt_algorithm.hpp @@ -46,7 +46,7 @@ intersect(const t_wt& wt, const std::vector& ranges, typename t_wt:: using p_t = std::pair; std::vector res; - auto push_node = [&wt, &t](stack_type& s, node_type& child, range_vec_type& child_range) { + auto push_node = [&t](stack_type& s, node_type& child, range_vec_type& child_range) { auto end = std::remove_if( child_range.begin(), child_range.end(), [&](const range_type& x) { return empty(x); }); if (end > child_range.begin() + t - 1) { diff --git a/test/search_bidirectional_test.cpp b/test/search_bidirectional_test.cpp index fb386abf5..99bd6ed77 100644 --- a/test/search_bidirectional_test.cpp +++ b/test/search_bidirectional_test.cpp @@ -1,3 +1,4 @@ +#include "common.hpp" #include #include "gtest/gtest.h" #include @@ -12,8 +13,11 @@ using namespace std; typedef sdsl::int_vector<>::size_type size_type; +tMSS test_case_file_map; string test_file; string test_file_rev; +string temp_file; +string temp_dir; template class search_bidirectional_test : public ::testing::Test { }; @@ -37,8 +41,12 @@ TYPED_TEST(search_bidirectional_test, bidirectional_search) TypeParam csa1; TypeParam csa1_rev; - construct(csa1, test_file, 1); - construct(csa1_rev, test_file_rev, 1); + + temp_file = sdsl::tmp_file(temp_dir+"/"+util::basename(test_file),util::basename(test_file)); + cache_config config(false, temp_dir, util::basename(temp_file)); + + construct(csa1, test_file, config, 1); + construct(csa1_rev, test_file_rev, config, 1); std::mt19937_64 rng(13); std::uniform_int_distribution distribution(0, csa1.size()-1); @@ -117,20 +125,21 @@ TYPED_TEST(search_bidirectional_test, bidirectional_search) } } +TYPED_TEST(search_bidirectional_test, delete_) +{ + sdsl::remove(temp_file); + sdsl::remove(test_file_rev); + util::delete_all_files(test_case_file_map); +} + } // namespace int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); - - if (argc < 2) { - cout << "Usage: " << argv[0] << " test_file" << endl; - cout << " (1) Reverses test_file; stores it in test_file_rev." << endl; - cout << " (2) Performs tests." << endl; - cout << " (3) Deletes test_file_reverse." << endl; + if (init_2_arg_test(argc, argv, "SEARCH_BIDIRECTIONAL", test_file, temp_dir, temp_file) != 0 ) { return 1; } - test_file = argv[1]; test_file_rev = test_file + "_rev"; { @@ -147,7 +156,6 @@ int main(int argc, char** argv) of.write(text2, n); of.close(); } - int result = RUN_ALL_TESTS(); - sdsl::remove(test_file_rev); - return result; + + return RUN_ALL_TESTS(); }