pubseekoff.pass.cpp revision 256813f4e7915d64776a4edd5f4765d893b9f062
1//===----------------------------------------------------------------------===//
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// <streambuf>
11
12// template <class charT, class traits = char_traits<charT> >
13// class basic_streambuf;
14
15// pos_type pubseekoff(off_type off, ios_base::seekdir way,
16//                     ios_base::openmode which = ios_base::in | ios_base::out);
17
18#include <streambuf>
19#include <cassert>
20
21template <class CharT>
22struct test
23    : public std::basic_streambuf<CharT>
24{
25    test() {}
26};
27
28int main()
29{
30    {
31        test<char> t;
32        assert(t.pubseekoff(0, std::ios_base::beg) == -1);
33        assert(t.pubseekoff(0, std::ios_base::beg, std::ios_base::app) == -1);
34    }
35}
36