summaryrefslogtreecommitdiff
path: root/test/xray/TestCases
diff options
context:
space:
mode:
Diffstat (limited to 'test/xray/TestCases')
-rw-r--r--test/xray/TestCases/Posix/profiling-multi-threaded.cc5
-rw-r--r--test/xray/TestCases/Posix/profiling-single-threaded.cc7
2 files changed, 8 insertions, 4 deletions
diff --git a/test/xray/TestCases/Posix/profiling-multi-threaded.cc b/test/xray/TestCases/Posix/profiling-multi-threaded.cc
index 7ccad1bac..45e5e7022 100644
--- a/test/xray/TestCases/Posix/profiling-multi-threaded.cc
+++ b/test/xray/TestCases/Posix/profiling-multi-threaded.cc
@@ -51,7 +51,8 @@ volatile int buffer_counter = 0;
assert(__xray_log_finalize() == XRayLogInitStatus::XRAY_LOG_FINALIZED);
assert(__xray_log_process_buffers(process_buffer) ==
XRayLogFlushStatus::XRAY_LOG_FLUSHED);
- // We're running three threds, so we expect three buffers.
- assert(buffer_counter == 3);
+ // We're running three threads, so we expect four buffers (including the file
+ // header buffer).
+ assert(buffer_counter == 4);
assert(__xray_log_flushLog() == XRayLogFlushStatus::XRAY_LOG_FLUSHED);
}
diff --git a/test/xray/TestCases/Posix/profiling-single-threaded.cc b/test/xray/TestCases/Posix/profiling-single-threaded.cc
index fd508b1ac..fc518145e 100644
--- a/test/xray/TestCases/Posix/profiling-single-threaded.cc
+++ b/test/xray/TestCases/Posix/profiling-single-threaded.cc
@@ -47,7 +47,10 @@ volatile int buffer_counter = 0;
f0();
assert(__xray_log_process_buffers(process_buffer) ==
XRayLogFlushStatus::XRAY_LOG_FLUSHED);
- assert(buffer_counter == 1);
+ // There's always at least one buffer, containing the profile file header. We
+ // assert that we have two, to indicate that we're expecting exactly one
+ // thread's worth of data.
+ assert(buffer_counter == 2);
assert(__xray_log_flushLog() == XRayLogFlushStatus::XRAY_LOG_FLUSHED);
// Let's reset the counter.
@@ -60,6 +63,6 @@ volatile int buffer_counter = 0;
f0();
assert(__xray_log_process_buffers(process_buffer) ==
XRayLogFlushStatus::XRAY_LOG_FLUSHED);
- assert(buffer_counter == 1);
+ assert(buffer_counter == 2);
assert(__xray_log_flushLog() == XRayLogFlushStatus::XRAY_LOG_FLUSHED);
}