From 877fdab084de2d62ca6169060d61465dbcaf1a28 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Wed, 14 Feb 2018 15:28:59 -0800 Subject: [PATCH] simpleperf: fix cmd_debug_unwind tests. Without flushing stdout, the tests may fail when running `adb shell simpleperf_unit_test`. Bug: none Test: run `adb shell simpleperf_unit_test`. Change-Id: I8bcf739e7672e8affc71df0a3f11264c0bd7f745 --- simpleperf/cmd_debug_unwind_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simpleperf/cmd_debug_unwind_test.cpp b/simpleperf/cmd_debug_unwind_test.cpp index 8bf93d32..153adb75 100644 --- a/simpleperf/cmd_debug_unwind_test.cpp +++ b/simpleperf/cmd_debug_unwind_test.cpp @@ -45,6 +45,7 @@ class CaptureStdout { } bool Start() { + fflush(stdout); old_stdout_ = dup(STDOUT_FILENO); if (old_stdout_ == -1) { return false; @@ -58,6 +59,7 @@ class CaptureStdout { } std::string Finish() { + fflush(stdout); started_ = false; dup2(old_stdout_, STDOUT_FILENO); close(old_stdout_); -- 2.11.0