示例#1
0
	hm.host(mv);
	TEST_EQUAL(mv.value_sum, 222)
RESULT

CHECK(bool has(const String& key) const throw())
	StringHashMap<int> hm;
	hm.insert("a", 0);
	hm.insert("b", 1);
	TEST_EQUAL(hm.has("a"), true)
	TEST_EQUAL(hm.has("b"), true)
	TEST_EQUAL(hm.has("c"), false)
RESULT

CHECK(bool isEmpty() const throw())
	StringHashMap<int> hm;
	TEST_EQUAL(hm.isEmpty(), true)
	hm.insert("a", 0);
	TEST_EQUAL(hm.isEmpty(), false)
	hm.clear();
	TEST_EQUAL(hm.isEmpty(), true)
RESULT

CHECK(bool operator == (const StringHashMap<Value>& hash_map) const throw())
	StringHashMap<int> hm;
	StringHashMap<int> hm2;
	TEST_EQUAL(hm == hm2, true)

	hm.insert("a", 0);
	hm.insert("b", 1);

	hm2.insert("a", 0);