Remove some non-determinism from the `Darwin/duplicate_os_log_reports.cpp` test.

The test read from an uninitialized buffer which could cause the output
to be unpredictable.

The test is currently disabled so this won't actually change anything
until the test is re-enabled.
This commit is contained in:
Dan Liew 2020-05-30 15:17:41 -07:00
parent 16976cb925
commit fc532c1a0d
1 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@
// RUN: FileCheck %s -input-file=%t.process_syslog_output.txt
#include <cassert>
#include <cstdio>
#include <cstring>
#include <sanitizer/asan_interface.h>
const int kBufferSize = 512;
@ -37,6 +38,7 @@ void readOne() {
int main() {
buffer = static_cast<char *>(malloc(kBufferSize));
memset(static_cast<void *>(buffer), static_cast<int>('.'), kBufferSize);
assert(buffer);
// Deliberately poison `buffer` so that we have a deterministic way
// triggering two ASan reports in a row in the no halt_on_error mode (e.g. Two