aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/istream_seeks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/istream_seeks.cc')
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_seeks.cc32
1 files changed, 18 insertions, 14 deletions
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks.cc b/libstdc++-v3/testsuite/27_io/istream_seeks.cc
index d5fad45..a9ea82f 100644
--- a/libstdc++-v3/testsuite/27_io/istream_seeks.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_seeks.cc
@@ -33,7 +33,7 @@ bool test01()
typedef ios::pos_type pos_type;
bool test = true;
- const char str_lit01[] = "istream_unformatted-1.tst";
+ const char str_lit01[] = "istream_seeks-1.tst";
// in
// test default ctors leave things in the same positions...
@@ -65,11 +65,13 @@ bool test01()
// fstreams
void test04(void)
{
+ typedef std::istream::off_type off_type;
+
bool test = true;
std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
std::ios_base::iostate state01, state02;
- const char str_lit01[] = "istream_unformatted-1.txt";
- const char str_lit02[] = "istream_unformatted-2.txt";
+ const char str_lit01[] = "istream_seeks-1.txt";
+ const char str_lit02[] = "istream_seeks-2.txt";
std::ifstream if01(str_lit01, std::ios_base::in | std::ios_base::out);
std::ifstream if02(str_lit01, std::ios_base::in);
std::ifstream if03(str_lit02, std::ios_base::out | std::ios_base::trunc);
@@ -112,7 +114,7 @@ void test04(void)
is01.seekg(10, std::ios_base::cur);
state02 = is01.rdstate();
pos01 = is01.tellg();
- VERIFY( pos01 == pos02 + 10 );
+ VERIFY( pos01 == pos02 + off_type(10) );
VERIFY( state01 == state02 );
pos02 = is01.tellg();
VERIFY( pos02 == pos01 );
@@ -121,7 +123,7 @@ void test04(void)
is02.seekg(10, std::ios_base::cur);
state02 = is02.rdstate();
pos03 = is02.tellg();
- VERIFY( pos03 == pos04 + 10 );
+ VERIFY( pos03 == pos04 + off_type(10) );
VERIFY( state01 == state02 );
pos04 = is02.tellg();
VERIFY( pos03 == pos04 );
@@ -130,7 +132,7 @@ void test04(void)
is03.seekg(10, std::ios_base::cur);
state02 = is03.rdstate();
pos05 = is03.tellg();
- VERIFY( pos05 == pos06 + 10 );
+ VERIFY( pos05 == pos06 + off_type(10) );
VERIFY( state01 == state02 );
pos06 = is03.tellg();
VERIFY( pos05 == pos06 );
@@ -140,7 +142,7 @@ void test04(void)
is01.seekg(20, std::ios_base::beg);
state02 = is01.rdstate();
pos01 = is01.tellg();
- VERIFY( pos01 == pos02 + 10 );
+ VERIFY( pos01 == pos02 + off_type(10) );
VERIFY( state01 == state02 );
pos02 = is01.tellg();
VERIFY( pos02 == pos01 );
@@ -149,7 +151,7 @@ void test04(void)
is02.seekg(20, std::ios_base::beg);
state02 = is02.rdstate();
pos03 = is02.tellg();
- VERIFY( pos03 == pos04 + 10 );
+ VERIFY( pos03 == pos04 + off_type(10) );
VERIFY( state01 == state02 );
pos04 = is02.tellg();
VERIFY( pos03 == pos04 );
@@ -158,7 +160,7 @@ void test04(void)
is03.seekg(20, std::ios_base::beg);
state02 = is03.rdstate();
pos05 = is03.tellg();
- VERIFY( pos05 == pos06 + 10 );
+ VERIFY( pos05 == pos06 + off_type(10) );
VERIFY( state01 == state02 );
pos06 = is03.tellg();
VERIFY( pos05 == pos06 );
@@ -171,10 +173,12 @@ void test04(void)
// stringstreams
void test05(void)
{
+ typedef std::istream::off_type off_type;
+
bool test = true;
std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
std::ios_base::iostate state01, state02;
- const char str_lit01[] = "istream_unformatted-1.tst";
+ const char str_lit01[] = "istream_seeks-1.tst";
std::ifstream if01(str_lit01);
std::ifstream if02(str_lit01);
std::ifstream if03(str_lit01);
@@ -224,7 +228,7 @@ void test05(void)
is01.seekg(10, std::ios_base::cur);
state02 = is01.rdstate();
pos01 = is01.tellg();
- VERIFY( pos01 == pos02 + 10 );
+ VERIFY( pos01 == pos02 + off_type(10) );
VERIFY( state01 == state02 );
pos02 = is01.tellg();
VERIFY( pos02 == pos01 );
@@ -233,7 +237,7 @@ void test05(void)
is02.seekg(10, std::ios_base::cur);
state02 = is02.rdstate();
pos03 = is02.tellg();
- VERIFY( pos03 == pos04 + 10 );
+ VERIFY( pos03 == pos04 + off_type(10) );
VERIFY( state01 == state02 );
pos04 = is02.tellg();
VERIFY( pos03 == pos04 );
@@ -252,7 +256,7 @@ void test05(void)
is01.seekg(20, std::ios_base::beg);
state02 = is01.rdstate();
pos01 = is01.tellg();
- VERIFY( pos01 == pos02 + 10 );
+ VERIFY( pos01 == pos02 + off_type(10) );
VERIFY( state01 == state02 );
pos02 = is01.tellg();
VERIFY( pos02 == pos01 );
@@ -261,7 +265,7 @@ void test05(void)
is02.seekg(20, std::ios_base::beg);
state02 = is02.rdstate();
pos03 = is02.tellg();
- VERIFY( pos03 == pos04 + 10 );
+ VERIFY( pos03 == pos04 + off_type(10) );
VERIFY( state01 == state02 );
pos04 = is02.tellg();
VERIFY( pos03 == pos04 );