add test case

This commit is contained in:
邹晓航
2015-01-12 13:50:12 +08:00
parent 4c88ceaad8
commit 077d5c6a19
2 changed files with 25 additions and 1 deletions

View File

@@ -2,6 +2,28 @@
namespace TinySTL{
namespace ListTest{
void testCase1(){
stdL<int> l1(10, 0);
tsL<int> l2(10, 0);
assert(TinySTL::Test::container_equal(l1, l2));
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
stdL<int> l3(std::begin(arr), std::end(arr));
tsL<int> l4(std::begin(arr), std::end(arr));
assert(TinySTL::Test::container_equal(l3, l4));
auto l5(l1);
auto l6(l2);
assert(TinySTL::Test::container_equal(l5, l6));
auto l7 = l1;
auto l8 = l2;
assert(TinySTL::Test::container_equal(l7, l8));
}
void testAllCases(){
testCase1();
}
}
}

View File

@@ -16,6 +16,8 @@ namespace TinySTL{
template<class T>
using tsL = TinySTL::list < T > ;
void testCase1();
void testAllCases();
}
}