39 const char*
const tmpfname =
rw_tmpnam (0);
41 assert (0 != fb.open (tmpfname, std::ios::out));
42 assert (6 == fb.sputn (
"ABCDEF", 6));
45 assert (0 != fb.open (tmpfname,
46 std::ios::in | std::ios::out | std::ios::stdio));
48 assert (3 == fb.sputn (
"abc", 3));
49 assert (-1 != fb.pubsync ());
53 assert (0 == std::filebuf::traits_type::compare (
"DEF",
buf, 3));
57 std::remove (tmpfname);
59#ifndef _RWSTD_NO_WCHAR_T
63 assert (0 != wfb.open (tmpfname, std::ios::out));
64 assert (6 == wfb.sputn (
L"ABCDEF", 6));
65 assert (0 != wfb.close ());
67 assert (0 != wfb.open (tmpfname,
68 std::ios::in | std::ios::out | std::ios::stdio));
70 assert (3 == wfb.sputn (
L"abc", 3));
71 assert (-1 != wfb.pubsync ());
73 wchar_t wbuf [3] =
L"";
74 assert (3 == wfb.sgetn (wbuf,
sizeof wbuf /
sizeof *wbuf));
75 assert (0 == std::wfilebuf::traits_type::compare (
L"DEF", wbuf, 3));
79 std::remove (tmpfname);
_TEST_EXPORT const char * rw_tmpnam(char *)