BuildBot fix, compiler complains about array decay to pointer
[llvm-core.git] / unittests / Support / formatted_raw_ostream_test.cpp
blob2b8f06523beb0653a2c3590f10e0db349154167d
1 //===- llvm/unittest/Support/formatted_raw_ostream_test.cpp ---------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #include "llvm/ADT/SmallString.h"
11 #include "llvm/Support/FormattedStream.h"
12 #include "llvm/Support/raw_ostream.h"
13 #include "gtest/gtest.h"
15 using namespace llvm;
17 namespace {
19 TEST(formatted_raw_ostreamTest, Test_Tell) {
20 // Check offset when underlying stream has buffer contents.
21 SmallString<128> A;
22 raw_svector_ostream B(A);
23 formatted_raw_ostream C(B);
24 char tmp[100] = "";
26 for (unsigned i = 0; i != 3; ++i) {
27 C.write(tmp, 100);
29 EXPECT_EQ(100*(i+1), (unsigned) C.tell());