Add wxVector::operator==() and !=()

Make this class more consistent with std::vector<>.
This commit is contained in:
Vadim Zeitlin
2017-11-18 16:28:22 +01:00
parent aef4edb969
commit 5669e8dbe9
3 changed files with 50 additions and 0 deletions

View File

@@ -314,3 +314,20 @@ void VectorsTestCase::Sort()
CPPUNIT_ASSERT( v[idx-1] <= v[idx] );
}
}
TEST_CASE("wxVector::operator==", "[vector][compare]")
{
wxVector<wxString> v1, v2;
CHECK( v1 == v2 );
CHECK( !(v1 != v2) );
v1.push_back("foo");
CHECK( v1 != v2 );
v2.push_back("foo");
CHECK( v1 == v2 );
v1.push_back("bar");
v2.push_back("baz");
CHECK( v1 != v2 );
}