|
From: <dav...@us...> - 2008-12-14 18:17:06
|
Revision: 3953
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3953&view=rev
Author: davybrion
Date: 2008-12-14 18:17:04 +0000 (Sun, 14 Dec 2008)
Log Message:
-----------
fix for NH-1608
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Util/LRUMap.cs
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/Fixture.cs
Modified: trunk/nhibernate/src/NHibernate/Util/LRUMap.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Util/LRUMap.cs 2008-12-14 14:03:45 UTC (rev 3952)
+++ trunk/nhibernate/src/NHibernate/Util/LRUMap.cs 2008-12-14 18:17:04 UTC (rev 3953)
@@ -50,7 +50,7 @@
}
set
{
- base[key] = value;
+ Add(key, value);
}
}
@@ -68,7 +68,7 @@
}
}
- base.Add(key, value);
+ base[key] = value;
}
private void RemoveLRU()
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/Fixture.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/Fixture.cs 2008-12-14 18:17:04 UTC (rev 3953)
@@ -0,0 +1,33 @@
+using NHibernate.Util;
+
+using NUnit.Framework;
+using NUnit.Framework.SyntaxHelpers;
+
+namespace NHibernate.Test.NHSpecificTest.NH1608
+{
+ [TestFixture]
+ public class Fixture
+ {
+ [Test]
+ public void AddDoesBoundsChecking()
+ {
+ var map = new LRUMap(128);
+
+ for (int i = 0; i < 200; i++)
+ map.Add("str" + i, i);
+
+ Assert.That(map.Count, Is.EqualTo(128));
+ }
+
+ [Test]
+ public void IndexerDoesBoundsChecking()
+ {
+ var map = new LRUMap(128);
+
+ for (int i = 0; i < 200; i++)
+ map["str" + i] = i;
+
+ Assert.That(map.Count, Is.EqualTo(128));
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-12-14 14:03:45 UTC (rev 3952)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-12-14 18:17:04 UTC (rev 3953)
@@ -542,6 +542,7 @@
<Compile Include="NHSpecificTest\NH1593\TestIndex.cs" />
<Compile Include="NHSpecificTest\NH1594\A.cs" />
<Compile Include="NHSpecificTest\NH1594\Fixture.cs" />
+ <Compile Include="NHSpecificTest\NH1608\Fixture.cs" />
<Compile Include="NHSpecificTest\NH280\Fixture.cs" />
<Compile Include="NHSpecificTest\NH280\Foo.cs" />
<Compile Include="NHSpecificTest\NH1018\Employee.cs" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|