diff options
author | Yabin Cui <yabinc@google.com> | 2018-02-14 15:28:59 -0800 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2018-02-14 15:28:59 -0800 |
commit | 877fdab084de2d62ca6169060d61465dbcaf1a28 (patch) | |
tree | cfaa6a86a8c151508e29ba1b2b3822029bb2986c | |
parent | 01ba2e6ed6f1e7a47b8c1b0aaf62627d32a7643e (diff) | |
download | extras-877fdab084de2d62ca6169060d61465dbcaf1a28.tar.gz |
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
-rw-r--r-- | simpleperf/cmd_debug_unwind_test.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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_); |