Skip to content

Commit

Permalink
tmp commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cpockrandt committed Dec 25, 2018
1 parent 8be2bd8 commit 8946268
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 24 deletions.
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/sdsl/divsufsort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename saidx_t>
Expand Down
2 changes: 1 addition & 1 deletion include/sdsl/wt_algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ intersect(const t_wt& wt, const std::vector<range_type>& ranges, typename t_wt::
using p_t = std::pair<value_type, size_type>;
std::vector<p_t> 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) {
Expand Down
32 changes: 20 additions & 12 deletions test/search_bidirectional_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "common.hpp"
#include <sdsl/suffix_arrays.hpp>
#include "gtest/gtest.h"
#include <iostream>
Expand All @@ -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 T>
class search_bidirectional_test : public ::testing::Test { };
Expand All @@ -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<uint64_t> distribution(0, csa1.size()-1);
Expand Down Expand Up @@ -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";

{
Expand All @@ -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();
}

0 comments on commit 8946268

Please sign in to comment.