Add raw_pwrite_stream type.
[oota-llvm.git] / unittests / Support / raw_pwrite_stream_test.cpp
1 //===- raw_pwrite_stream_test.cpp - raw_pwrite_stream tests ---------------===//
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 //===----------------------------------------------------------------------===//
9
10 #include "gtest/gtest.h"
11 #include "llvm/ADT/SmallString.h"
12 #include "llvm/Support/raw_ostream.h"
13
14 using namespace llvm;
15
16 namespace {
17
18 TEST(raw_pwrite_ostreamTest, TestSVector) {
19   SmallString<64> Buffer;
20   raw_svector_ostream OS(Buffer);
21   StringRef Test = "test";
22   OS.pwrite(Test.data(), Test.size(), 0);
23   EXPECT_EQ(Test, OS.str());
24 }
25 }