2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Removed "using namespace std;" from all sources. Appended std:: 
prefix to c++
	standard classes.
	Included string.h where mem* function are used.
This commit is contained in:
Tatsuhiro Tsujikawa
2008-02-08 15:53:45 +00:00
parent d82e183d34
commit 1b7c198289
801 changed files with 12024 additions and 8627 deletions

View File

@@ -1,6 +1,9 @@
#include "AlphaNumberDecorator.h"
#include <iostream>
#include <cppunit/extensions/HelperMacros.h>
namespace aria2 {
class AlphaNumberDecoratorTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(AlphaNumberDecoratorTest);
@@ -24,18 +27,18 @@ CPPUNIT_TEST_SUITE_REGISTRATION( AlphaNumberDecoratorTest );
void AlphaNumberDecoratorTest::testDecorate()
{
CPPUNIT_ASSERT_EQUAL(string("a"), AlphaNumberDecorator(1).decorate(0));
CPPUNIT_ASSERT_EQUAL(string("z"), AlphaNumberDecorator(1).decorate(25));
CPPUNIT_ASSERT_EQUAL(string("zz"), AlphaNumberDecorator(1).decorate(675)); // 25*26+25
CPPUNIT_ASSERT_EQUAL(string("aab"), AlphaNumberDecorator(3).decorate(1));
CPPUNIT_ASSERT_EQUAL(std::string("a"), AlphaNumberDecorator(1).decorate(0));
CPPUNIT_ASSERT_EQUAL(std::string("z"), AlphaNumberDecorator(1).decorate(25));
CPPUNIT_ASSERT_EQUAL(std::string("zz"), AlphaNumberDecorator(1).decorate(675)); // 25*26+25
CPPUNIT_ASSERT_EQUAL(std::string("aab"), AlphaNumberDecorator(3).decorate(1));
}
void AlphaNumberDecoratorTest::testDecorate_uppercase()
{
CPPUNIT_ASSERT_EQUAL(string("A"), AlphaNumberDecorator(1, true).decorate(0));
CPPUNIT_ASSERT_EQUAL(string("Z"), AlphaNumberDecorator(1, true).decorate(25));
CPPUNIT_ASSERT_EQUAL(string("ZZ"), AlphaNumberDecorator(1, true).decorate(675)); // 25*26+25
CPPUNIT_ASSERT_EQUAL(string("AAB"), AlphaNumberDecorator(3, true).decorate(1));
CPPUNIT_ASSERT_EQUAL(std::string("A"), AlphaNumberDecorator(1, true).decorate(0));
CPPUNIT_ASSERT_EQUAL(std::string("Z"), AlphaNumberDecorator(1, true).decorate(25));
CPPUNIT_ASSERT_EQUAL(std::string("ZZ"), AlphaNumberDecorator(1, true).decorate(675)); // 25*26+25
CPPUNIT_ASSERT_EQUAL(std::string("AAB"), AlphaNumberDecorator(3, true).decorate(1));
}
void AlphaNumberDecoratorTest::testDecorate_minus()
@@ -44,9 +47,11 @@ void AlphaNumberDecoratorTest::testDecorate_minus()
AlphaNumberDecorator(1, true).decorate(-1);
CPPUNIT_FAIL("exception must be thrown.");
} catch(DlAbortEx* e) {
cerr << e->getMsg() << endl;
std::cerr << e->getMsg() << std::endl;
delete e;
} catch(...) {
CPPUNIT_FAIL("DlAbortEx must be thrown.");
}
}
} // namespace aria2