1 //===- llvm/unittest/Support/formatted_raw_ostream_test.cpp ---------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/ADT/SmallString.h"
10 #include "llvm/Support/FormattedStream.h"
11 #include "llvm/Support/raw_ostream.h"
12 #include "gtest/gtest.h"
18 TEST(formatted_raw_ostreamTest
, Test_Tell
) {
19 // Check offset when underlying stream has buffer contents.
21 raw_svector_ostream
B(A
);
22 formatted_raw_ostream
C(B
);
25 for (unsigned i
= 0; i
!= 3; ++i
) {
28 EXPECT_EQ(100*(i
+1), (unsigned) C
.tell());