mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 14:56:07 +00:00
Bug 849654: Kill nsDataHashtableMT. r=bsmedberg
This commit is contained in:
parent
4197941c60
commit
00a79ec7f1
@ -22,9 +22,4 @@ class nsDataHashtable :
|
||||
public nsBaseHashtable<KeyClass,DataType,DataType>
|
||||
{ };
|
||||
|
||||
template<class KeyClass,class DataType>
|
||||
class nsDataHashtableMT :
|
||||
public nsBaseHashtableMT<KeyClass,DataType,DataType>
|
||||
{ };
|
||||
|
||||
#endif // nsDataHashtable_h__
|
||||
|
@ -474,65 +474,6 @@ main(void) {
|
||||
|
||||
printf("OK\n");
|
||||
|
||||
//
|
||||
// now check a thread-safe data-hashtable
|
||||
//
|
||||
|
||||
nsDataHashtableMT<nsUint32HashKey,const char*> UniToEntityL;
|
||||
|
||||
printf("Initializing nsDataHashtableMT...");
|
||||
UniToEntityL.Init(ENTITY_COUNT);
|
||||
printf("OK\n");
|
||||
|
||||
printf("Filling hash with %u entries.\n", ENTITY_COUNT);
|
||||
|
||||
for (i = 0; i < ENTITY_COUNT; ++i) {
|
||||
printf(" Putting entry %u...", gEntities[i].mUnicode);
|
||||
UniToEntityL.Put(gEntities[i].mUnicode, gEntities[i].mStr);
|
||||
printf("OK...\n");
|
||||
}
|
||||
|
||||
printf("Testing Get:\n");
|
||||
|
||||
for (i = 0; i < ENTITY_COUNT; ++i) {
|
||||
printf(" Getting entry %u...", gEntities[i].mUnicode);
|
||||
if (!UniToEntityL.Get(gEntities[i].mUnicode, &str)) {
|
||||
printf("FAILED\n");
|
||||
exit (12);
|
||||
}
|
||||
|
||||
printf("Found %s\n", str);
|
||||
}
|
||||
|
||||
printf("Testing nonexistent entries...");
|
||||
if (UniToEntityL.Get(99446, &str)) {
|
||||
printf("FOUND! BAD!\n");
|
||||
exit (13);
|
||||
}
|
||||
|
||||
printf("not found; good.\n");
|
||||
|
||||
printf("Enumerating:\n");
|
||||
|
||||
count = UniToEntityL.EnumerateRead(nsDEnumRead, nullptr);
|
||||
if (count != ENTITY_COUNT) {
|
||||
printf(" Bad count!\n");
|
||||
exit (14);
|
||||
}
|
||||
|
||||
printf("Clearing...");
|
||||
UniToEntityL.Clear();
|
||||
printf("OK\n");
|
||||
|
||||
printf("Checking count...");
|
||||
count = UniToEntityL.Enumerate(nsDEnum, nullptr);
|
||||
if (count) {
|
||||
printf(" Clear did not remove all entries.\n");
|
||||
exit (15);
|
||||
}
|
||||
|
||||
printf("OK\n");
|
||||
|
||||
//
|
||||
// now check a class-hashtable
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user