|
@@ -20,7 +20,7 @@ public:
|
|
|
|
|
|
CPPUNIT_TEST_SUITE_REGISTRATION(SequenceTest);
|
|
|
|
|
|
-typedef Sequence<int32_t> IntSequence;
|
|
|
+typedef Sequence<int> IntSequence;
|
|
|
|
|
|
void SequenceTest::testParseAndNext()
|
|
|
{
|
|
@@ -31,23 +31,23 @@ void SequenceTest::testParseAndNext()
|
|
|
};
|
|
|
IntSequence seq = IntSequence(IntSequence::Values(¶ms[0], ¶ms[3]));
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)1, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(1, seq.next());
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)3, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(3, seq.next());
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)4, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(4, seq.next());
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)5, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(5, seq.next());
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)6, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(6, seq.next());
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)7, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(7, seq.next());
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)8, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(8, seq.next());
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)10, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(10, seq.next());
|
|
|
CPPUNIT_ASSERT(!seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)0, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(0, seq.next());
|
|
|
|
|
|
}
|
|
|
|
|
@@ -58,9 +58,9 @@ void SequenceTest::testParseAndNext2()
|
|
|
};
|
|
|
IntSequence seq = IntSequence(IntSequence::Values(¶ms[0], ¶ms[1]));
|
|
|
CPPUNIT_ASSERT(seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)1, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(1, seq.next());
|
|
|
CPPUNIT_ASSERT(!seq.hasNext());
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)0, seq.next());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(0, seq.next());
|
|
|
|
|
|
}
|
|
|
|
|
@@ -72,11 +72,11 @@ void SequenceTest::testFlush()
|
|
|
IntSequence::Value(10, 11),
|
|
|
};
|
|
|
IntSequence seq = IntSequence(IntSequence::Values(¶ms[0], ¶ms[3]));
|
|
|
- std::deque<int32_t> r = seq.flush();
|
|
|
+ std::deque<int> r = seq.flush();
|
|
|
|
|
|
- int32_t answers[] = { 1, 3, 4, 5, 6, 7, 8, 10 };
|
|
|
+ int answers[] = { 1, 3, 4, 5, 6, 7, 8, 10 };
|
|
|
|
|
|
- CPPUNIT_ASSERT(equal(r.begin(), r.end(), &answers[0]));
|
|
|
+ CPPUNIT_ASSERT(std::equal(r.begin(), r.end(), &answers[0]));
|
|
|
}
|
|
|
|
|
|
} // namespace aria2
|