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 $
28 #include "utility/debug.h"
29 #include "utility/c_charbuf.h"
34 MESSAGE(cerr, "TEST 1");
42 MESSAGE(cerr, "examine char a:");
43 debug(cerr, (char)sb.examine());
45 MESSAGE(cerr, "get char a:");
53 MESSAGE(cerr, "putback char a:");
56 MESSAGE(cerr, "get char a - e:");
57 debug(cerr, (char)sb.get());
58 debug(cerr, (char)sb.get());
59 debug(cerr, (char)sb.get());
60 debug(cerr, (char)sb.get());
61 debug(cerr, (char)sb.get());
66 MESSAGE(cerr, "TEST 2");
73 MESSAGE(cerr, "get 0:");
74 debug(cerr, sb.get());
75 MESSAGE(cerr, "get 1:");
76 debug(cerr, sb.get());
77 MESSAGE(cerr, "get -1:");
78 debug(cerr, sb.get());
81 MESSAGE(cerr, "get 2:");
82 debug(cerr, sb.get());
87 MESSAGE(cerr, "TEST 3");
91 MESSAGE(cerr, "return 0:");
92 debug(cerr, sb.put(0));
93 MESSAGE(cerr, "return 0:");
94 debug(cerr, sb.put(1));
95 MESSAGE(cerr, "return 0:");
96 debug(cerr, sb.put(2));
97 MESSAGE(cerr, "return 0:");
98 debug(cerr, sb.put(3));
99 MESSAGE(cerr, "return 0:");
100 debug(cerr, sb.put(4));
101 MESSAGE(cerr, "return -1:");
102 debug(cerr, sb.put(5));
103 MESSAGE(cerr, "return -1:");
104 debug(cerr, sb.put(6));
109 MESSAGE(cerr, "TEST 4");
113 debug(cerr, sb.putback(0));
114 debug(cerr, sb.putback(1));
115 debug(cerr, sb.putback(2));
116 debug(cerr, sb.putback(3));
117 debug(cerr, sb.putback(4));
119 MESSAGE(cerr, "get 4:");
120 debug(cerr, sb.get());
121 MESSAGE(cerr, "get 3:");
122 debug(cerr, sb.get());
123 MESSAGE(cerr, "get 2:");
124 debug(cerr, sb.get());
125 MESSAGE(cerr, "get 1:");
126 debug(cerr, sb.get());
127 MESSAGE(cerr, "get 0:");
128 debug(cerr, sb.get());