From 5bf1b0e5f500b6b99a866da32dd9002219cac6d6 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sat, 28 May 2016 22:28:26 -0700 Subject: fix random lint issues This only eliminates errors reported by `make lint`. It shouldn't cause any functional changes. This change does remove several functions that are unused. It also removes the `desc_arr` variable which is both unused and out of date with reality. --- src/fish_tests.cpp | 63 +----------------------------------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) (limited to 'src/fish_tests.cpp') diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 49c9327b..29040e22 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -60,7 +61,6 @@ #include "signal.h" #include "tokenizer.h" #include "utf8.h" -#include "util.h" #include "wcstringutil.h" #include "wildcard.h" #include "wutil.h" // IWYU pragma: keep @@ -2194,62 +2194,6 @@ static void test_autosuggestion_combining() { do_test(combine_command_and_autosuggestion(L"alpha", L"ALPHA") == L"alpha"); } -/// Test speed of completion calculations. -void perf_complete() { - wchar_t c; - std::vector out; - long long t1, t2; - int matches = 0; - double t; - wchar_t str[3] = {0, 0, 0}; - int i; - - say(L"Testing completion performance"); - - reader_push(L""); - say(L"Here we go"); - - t1 = get_time(); - - for (c = L'a'; c <= L'z'; c++) { - str[0] = c; - reader_set_buffer(str, 0); - - complete(str, &out, COMPLETION_REQUEST_DEFAULT, env_vars_snapshot_t::current()); - - matches += out.size(); - out.clear(); - } - t2 = get_time(); - - t = (double)(t2 - t1) / (1000000 * 26); - - say(L"One letter command completion took %f seconds per completion, %f microseconds/match", t, - (double)(t2 - t1) / matches); - - matches = 0; - t1 = get_time(); - for (i = 0; i < LAPS; i++) { - str[0] = 'a' + (rand() % 26); - str[1] = 'a' + (rand() % 26); - - reader_set_buffer(str, 0); - - complete(str, &out, COMPLETION_REQUEST_DEFAULT, env_vars_snapshot_t::current()); - - matches += out.size(); - out.clear(); - } - t2 = get_time(); - - t = (double)(t2 - t1) / (1000000 * LAPS); - - say(L"Two letter command completion took %f seconds per completion, %f microseconds/match", t, - (double)(t2 - t1) / matches); - - reader_pop(); -} - static void test_history_matches(history_search_t &search, size_t matches) { size_t i; for (i = 0; i < matches; i++) { @@ -3937,11 +3881,6 @@ int main(int argc, char **argv) { say(L"Encountered %d errors in low-level tests", err_count); if (s_test_run_count == 0) say(L"*** No Tests Were Actually Run! ***"); - // Skip performance tests for now, since they seem to hang when running from inside make. - - // say( L"Testing performance" ); - // perf_complete(); - reader_destroy(); builtin_destroy(); event_destroy(); -- cgit v1.2.3