summaryrefslogtreecommitdiff
path: root/test/array_funTest.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-08 15:53:45 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-08 15:53:45 +0000
commit1b7c1982896dba1d38e1fe84ba9660996607f5f9 (patch)
treed12047cb37ded1e18d4d5b97844412538beb19ff /test/array_funTest.cc
parentd82e183d346375ac8a58a298a58728be615f947e (diff)
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.
Diffstat (limited to 'test/array_funTest.cc')
-rw-r--r--test/array_funTest.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/array_funTest.cc b/test/array_funTest.cc
index 32fe0b6f..560d72a7 100644
--- a/test/array_funTest.cc
+++ b/test/array_funTest.cc
@@ -1,7 +1,7 @@
#include "array_fun.h"
#include <cppunit/extensions/HelperMacros.h>
-using namespace std;
+namespace aria2 {
class array_funTest:public CppUnit::TestFixture {
@@ -10,12 +10,14 @@ class array_funTest:public CppUnit::TestFixture {
CPPUNIT_TEST(testBit_and);
CPPUNIT_TEST(testArray_negate);
CPPUNIT_TEST(testArray_and);
+ CPPUNIT_TEST(testArrayLength);
CPPUNIT_TEST_SUITE_END();
public:
void testBit_negate();
void testBit_and();
void testArray_negate();
void testArray_and();
+ void testArrayLength();
};
@@ -65,3 +67,14 @@ void array_funTest::testArray_and()
CPPUNIT_ASSERT_EQUAL((unsigned char)0x45, f4[0]);
CPPUNIT_ASSERT_EQUAL((unsigned char)0x8a, f4[1]);
}
+
+void array_funTest::testArrayLength()
+{
+ int64_t ia[] = { 1, 2, 3, 4, 5 };
+ int64_t zeroLengthArray[] = {};
+
+ CPPUNIT_ASSERT_EQUAL((size_t)5, arrayLength(ia));
+ CPPUNIT_ASSERT_EQUAL((size_t)0, arrayLength(zeroLengthArray));
+}
+
+} // namespace aria2