[Scummvm-cvs-logs] SF.net SVN: scummvm: [32343] scummvm/trunk

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Wed May 28 20:32:06 CEST 2008


Revision: 32343
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32343&view=rev
Author:   wjpalenstijn
Date:     2008-05-28 11:32:05 -0700 (Wed, 28 May 2008)

Log Message:
-----------
Decrement _nele when erasing an element from hashmap, and add a test-case for this bug.

Modified Paths:
--------------
    scummvm/trunk/common/hashmap.h
    scummvm/trunk/test/common/hashmap.h

Modified: scummvm/trunk/common/hashmap.h
===================================================================
--- scummvm/trunk/common/hashmap.h	2008-05-28 15:03:30 UTC (rev 32342)
+++ scummvm/trunk/common/hashmap.h	2008-05-28 18:32:05 UTC (rev 32343)
@@ -535,6 +535,7 @@
 		}
 	}
 	_arr[i] = NULL;
+	_nele--;
 	return;
 }
 

Modified: scummvm/trunk/test/common/hashmap.h
===================================================================
--- scummvm/trunk/test/common/hashmap.h	2008-05-28 15:03:30 UTC (rev 32342)
+++ scummvm/trunk/test/common/hashmap.h	2008-05-28 18:32:05 UTC (rev 32343)
@@ -37,6 +37,9 @@
 		TS_ASSERT( !container.contains(1) );
 		container[1] = 42;
 		TS_ASSERT( container.contains(1) );
+		container.erase(0);
+		container.erase(1);
+		TS_ASSERT( container.empty() );
 	}
 
 	void test_lookup( void )


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list