Commit 906a05bc authored by hjk's avatar hjk
Browse files

add a test case for std::deque

parent 43dcbae9
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#include <QtNetwork/QHostAddress> #include <QtNetwork/QHostAddress>
#include <deque>
#include <iostream> #include <iostream>
#include <map> #include <map>
#include <list> #include <list>
...@@ -444,6 +445,29 @@ void stringRefTest(const QString &refstring) ...@@ -444,6 +445,29 @@ void stringRefTest(const QString &refstring)
Q_UNUSED(refstring); Q_UNUSED(refstring);
} }
void testStdDeque()
{
std::deque<int *> plist1;
plist1.push_back(new int(1));
plist1.push_back(0);
plist1.push_back(new int(2));
plist1.pop_back();
plist1.pop_front();
plist1.pop_front();
std::deque<int> flist2;
flist2.push_back(1);
flist2.push_back(2);
std::deque<Foo *> plist;
plist.push_back(new Foo(1));
plist.push_back(new Foo(2));
std::deque<Foo> flist;
flist.push_back(1);
flist.push_front(2);
}
void testStdList() void testStdList()
{ {
std::list<int *> plist1; std::list<int *> plist1;
...@@ -911,6 +935,7 @@ int main(int argc, char *argv[]) ...@@ -911,6 +935,7 @@ int main(int argc, char *argv[])
testHidden(); testHidden();
testArray(); testArray();
testStdDeque();
testStdList(); testStdList();
testStdMap(); testStdMap();
testStdStack(); testStdStack();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment