#include "wvtest.h" #include "wvscatterhash.h" #include "wvstring.h" DeclareWvScatterTable2(TestScatter, WvString); WVTEST_MAIN("scatterhash basics") { TestScatter h; WVPASS(h.isempty()); WVFAIL(h.count()); WvString s("foo"); h.add(new WvString(s), true); WVPASSEQ(h.count(), 1); h.remove(&s); // not the same object we added, but compares equal WVPASS(h.isempty()); } WVTEST_MAIN("scatter hashing count, add, remove") { const int size = 100; //must be larger the 50 WvString *strings[size]; for (int i=0;i