banshee r3921 - in trunk/banshee: . build src/Libraries/Hyena/Hyena.Collections tests/Hyena
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3921 - in trunk/banshee: . build src/Libraries/Hyena/Hyena.Collections tests/Hyena
- Date: Sat, 17 May 2008 08:18:47 +0100 (BST)
Author: abock
Date: Sat May 17 07:18:47 2008
New Revision: 3921
URL: http://svn.gnome.org/viewvc/banshee?rev=3921&view=rev
Log:
2008-05-17 Aaron Bockover <abock gnome org>
Patch from Bertrand Lorentz (BGO #533099)
* src/Libraries/Hyena/Hyena.Collections/RangeCollection.cs: Fix a
dyslexia bug in the NET_1_1 version of the array resize code
* build/build.rules.mk: Define NET_2_0 on the build so we end up
using the better version of RangeCollection - whoops
* tests/Hyena/RangeCollectionTests.cs: Added test to check for the
NET_1_1 array resize bug fixed above
Modified:
trunk/banshee/ChangeLog
trunk/banshee/build/build.rules.mk
trunk/banshee/src/Libraries/Hyena/Hyena.Collections/RangeCollection.cs
trunk/banshee/tests/Hyena/RangeCollectionTests.cs
Modified: trunk/banshee/build/build.rules.mk
==============================================================================
--- trunk/banshee/build/build.rules.mk (original)
+++ trunk/banshee/build/build.rules.mk Sat May 17 07:18:47 2008
@@ -46,7 +46,7 @@
test "x$$colors" = "xyes" && \
echo -e "\033[1mCompiling $(notdir $@)...\033[0m" || \
echo "Compiling $(notdir $@)...";
- @test "x$(DEVEL_BUILD)" = "xyes" && warn="-warnaserror"; $(BUILD) -target:$(TARGET) -out:$@ $$warn -define:HAVE_GTK_2_10 $(FILTERED_LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD)
+ @test "x$(DEVEL_BUILD)" = "xyes" && warn="-warnaserror"; $(BUILD) -target:$(TARGET) -out:$@ $$warn -define:HAVE_GTK_2_10 -define:NET_2_0 $(FILTERED_LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD)
@if [ -e $(notdir $ config) ]; then \
cp $(notdir $ config) $(top_builddir)/bin; \
fi;
Modified: trunk/banshee/src/Libraries/Hyena/Hyena.Collections/RangeCollection.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.Collections/RangeCollection.cs (original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.Collections/RangeCollection.cs Sat May 17 07:18:47 2008
@@ -135,7 +135,7 @@
#else
Range [] new_ranges = new Range[new_capacity];
Array.Copy (ranges, 0, new_ranges, 0, ranges.Length);
- new_ranges = ranges;
+ ranges = new_ranges;
#endif
}
Modified: trunk/banshee/tests/Hyena/RangeCollectionTests.cs
==============================================================================
--- trunk/banshee/tests/Hyena/RangeCollectionTests.cs (original)
+++ trunk/banshee/tests/Hyena/RangeCollectionTests.cs Sat May 17 07:18:47 2008
@@ -90,7 +90,28 @@
Assert.AreEqual (n, i);
}
-
+
+ [Test]
+ public void TestLargeNonAdjacent ()
+ {
+ RangeCollection range = new RangeCollection ();
+ int i, n = 1000000;
+
+ for (i = 0; i < n; i += 2) {
+ range.Add (i);
+ }
+
+ Assert.AreEqual (n / 2, range.Count);
+
+ i = 0;
+ foreach (int j in range) {
+ Assert.AreEqual (i, j);
+ i += 2;
+ }
+
+ Assert.AreEqual (n, i);
+ }
+
private static void _TestRanges (RangeCollection range, int [] indexes)
{
foreach (int index in indexes) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]