1 //===----------------------------------------------------------------------===//
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 //===----------------------------------------------------------------------===//
13 // strstreambuf(const signed char* gnext_arg, streamsize n);
18 #include "test_macros.h"
23 const signed char buf
[] = "abcd";
24 std::strstreambuf
sb(buf
, sizeof(buf
));
25 assert(sb
.sgetc() == 'a');
26 assert(sb
.snextc() == 'b');
27 assert(sb
.snextc() == 'c');
28 assert(sb
.snextc() == 'd');
29 assert(sb
.snextc() == 0);
30 assert(sb
.snextc() == EOF
);
33 const signed char buf
[] = "abcd";
34 std::strstreambuf
sb(buf
, 0);
35 assert(sb
.sgetc() == 'a');
36 assert(sb
.snextc() == 'b');
37 assert(sb
.snextc() == 'c');
38 assert(sb
.snextc() == 'd');
39 assert(sb
.snextc() == EOF
);