From 144e7b06162e8326d631091f6dfd067cb9ee2f44 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 23 Jan 2017 10:45:48 -0800 Subject: [PATCH] Adopt lamba-style perform_on_main in the tests --- src/fish_tests.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index fb83a4f32..2c926d19a 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -511,16 +511,10 @@ static void test_tokenizer() { err(L"redirection_type_for_string failed on line %ld", (long)__LINE__); } -// Little function that runs in the main thread. -static int test_iothread_main_call(int *addr) { - *addr += 1; - return *addr; -} - // Little function that runs in a background thread, bouncing to the main. static int test_iothread_thread_call(int *addr) { int before = *addr; - iothread_perform_on_main(test_iothread_main_call, addr); + iothread_perform_on_main([=](){ *addr += 1; }); int after = *addr; // Must have incremented it at least once.