#include class StlTraits : public CxxTest::TestSuite { public: typedef CXXTEST_STD(string) String; typedef CXXTEST_STD(pair) IntString; typedef CXXTEST_STD(pair) StringDouble; void test_Pair() { IntString three(3, "Three"); TS_FAIL(three); StringDouble four("Four", 4.0); TS_FAIL(four); } void test_Vector() { CXXTEST_STD(vector) v; TS_TRACE(v); v.push_back(1); v.push_back(2); v.push_back(3); TS_FAIL(v); CXXTEST_STD(vector) w; TS_TRACE(w); w.push_back("One"); w.push_back("Two"); w.push_back("Three"); TS_FAIL(w); CXXTEST_STD(vector) vw; TS_TRACE(vw); vw.push_back(IntString(1, "One")); vw.push_back(IntString(2, "Two")); vw.push_back(IntString(3, "Three")); TS_FAIL(vw); } void test_List() { CXXTEST_STD(list) v; TS_TRACE(v); v.push_back(1); v.push_back(2); v.push_back(3); TS_FAIL(v); CXXTEST_STD(list) w; TS_TRACE(w); w.push_back("One"); w.push_back("Two"); w.push_back("Three"); TS_FAIL(w); CXXTEST_STD(list) vw; TS_TRACE(vw); vw.push_back(IntString(1, "One")); vw.push_back(IntString(2, "Two")); vw.push_back(IntString(3, "Three")); TS_FAIL(vw); } void test_Set() { CXXTEST_STD(set) v; TS_TRACE(v); v.insert(1); v.insert(2); v.insert(3); TS_FAIL(v); CXXTEST_STD(set) w; TS_TRACE(w); w.insert("One"); w.insert("Two"); w.insert("Three"); TS_FAIL(w); CXXTEST_STD(set) vw; TS_TRACE(vw); vw.insert(IntString(1, "One")); vw.insert(IntString(2, "Two")); vw.insert(IntString(3, "Three")); TS_FAIL(vw); } void test_Map() { CXXTEST_STD(map) m; TS_TRACE(m); m["Jack"] = "Jill"; m["Humpty"] = "Dumpty"; m["Ren"] = "Stimpy"; TS_FAIL(m); CXXTEST_STD(map)< unsigned, CXXTEST_STD(list) > n; TS_TRACE(n); n[6].push_back(2); n[6].push_back(3); n[210].push_back(2); n[210].push_back(3); n[210].push_back(5); n[210].push_back(7); TS_FAIL(n); } void test_Deque() { CXXTEST_STD(deque) d; TS_TRACE(d); d.push_front(1); d.push_front(2); d.push_front(3); d.push_front(4); TS_FAIL(d); } void test_MultiMap() { CXXTEST_STD(multimap) mm; TS_TRACE(mm); mm.insert(StringDouble("One", 1.0)); mm.insert(StringDouble("Two", 2.0)); TS_FAIL(mm); } void test_MultiSet() { CXXTEST_STD(multiset) ms; TS_TRACE(ms); ms.insert(123); ms.insert(456); TS_FAIL(ms); } void test_Complex() { typedef CXXTEST_STD(complex) Complex; TS_FAIL(Complex(3.14, 2.71)); TS_FAIL(Complex(0.0, 1.0)); TS_FAIL(Complex(1.0, 0.0)); } };