2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $XConsortium: tst_streambuf.C /main/4 1996/08/21 15:55:40 drk $
27 #include "utility/debug.h"
28 #include "utility/c_charbuf.h"
33 MESSAGE(cerr, "TEST 1");
41 MESSAGE(cerr, "examine char a:");
42 debug(cerr, (char)sb.examine());
44 MESSAGE(cerr, "get char a:");
52 MESSAGE(cerr, "putback char a:");
55 MESSAGE(cerr, "get char a - e:");
56 debug(cerr, (char)sb.get());
57 debug(cerr, (char)sb.get());
58 debug(cerr, (char)sb.get());
59 debug(cerr, (char)sb.get());
60 debug(cerr, (char)sb.get());
65 MESSAGE(cerr, "TEST 2");
72 MESSAGE(cerr, "get 0:");
73 debug(cerr, sb.get());
74 MESSAGE(cerr, "get 1:");
75 debug(cerr, sb.get());
76 MESSAGE(cerr, "get -1:");
77 debug(cerr, sb.get());
80 MESSAGE(cerr, "get 2:");
81 debug(cerr, sb.get());
86 MESSAGE(cerr, "TEST 3");
90 MESSAGE(cerr, "return 0:");
91 debug(cerr, sb.put(0));
92 MESSAGE(cerr, "return 0:");
93 debug(cerr, sb.put(1));
94 MESSAGE(cerr, "return 0:");
95 debug(cerr, sb.put(2));
96 MESSAGE(cerr, "return 0:");
97 debug(cerr, sb.put(3));
98 MESSAGE(cerr, "return 0:");
99 debug(cerr, sb.put(4));
100 MESSAGE(cerr, "return -1:");
101 debug(cerr, sb.put(5));
102 MESSAGE(cerr, "return -1:");
103 debug(cerr, sb.put(6));
108 MESSAGE(cerr, "TEST 4");
112 debug(cerr, sb.putback(0));
113 debug(cerr, sb.putback(1));
114 debug(cerr, sb.putback(2));
115 debug(cerr, sb.putback(3));
116 debug(cerr, sb.putback(4));
118 MESSAGE(cerr, "get 4:");
119 debug(cerr, sb.get());
120 MESSAGE(cerr, "get 3:");
121 debug(cerr, sb.get());
122 MESSAGE(cerr, "get 2:");
123 debug(cerr, sb.get());
124 MESSAGE(cerr, "get 1:");
125 debug(cerr, sb.get());
126 MESSAGE(cerr, "get 0:");
127 debug(cerr, sb.get());