[Haiku-commits] r30958 - haiku/trunk/src/tests/system/kernel/cache
axeld at mail.berlios.de
axeld at mail.berlios.de
Thu Jun 4 14:11:38 CEST 2009
Author: axeld
Date: 2009-06-04 14:11:37 +0200 (Thu, 04 Jun 2009)
New Revision: 30958
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=30958&view=rev
Modified:
haiku/trunk/src/tests/system/kernel/cache/file_map_test.cpp
Log:
* Fixed Map::GetFileMap(), added some more tests.
Modified: haiku/trunk/src/tests/system/kernel/cache/file_map_test.cpp
===================================================================
--- haiku/trunk/src/tests/system/kernel/cache/file_map_test.cpp 2009-06-04 10:50:09 UTC (rev 30957)
+++ haiku/trunk/src/tests/system/kernel/cache/file_map_test.cpp 2009-06-04 12:11:37 UTC (rev 30958)
@@ -194,7 +194,7 @@
if (count >= *_vecCount)
return B_BUFFER_OVERFLOW;
if ((uint32)index >= fCount)
- return B_OK;
+ break;
off_t diff = offset - fOffsets[index];
vecs[count].offset = fVecs[index].offset + diff;
@@ -208,6 +208,7 @@
count++;
}
+ *_vecCount = count;
return B_OK;
}
@@ -314,5 +315,22 @@
map.Add(0, 8192, 1000).SetSize(7777);
map.Test();
+ map.SetTo("shrink2", 8888);
+ map.Add(0, 10000, 3330000);
+ map.Test();
+ map.SetSize(0);
+ map.SetSize(4444);
+ map.Clear();
+ map.Add(0, 5000, 2220000);
+ map.Test();
+
+ map.SetTo("shrink3", 256000);
+ map.Add(0, 98304, 188074464);
+ map.Add(98304, 38912, 189057024);
+ map.Add(137216, 118784, 189177856);
+ map.Test();
+ map.SetSize(0);
+ map.Test();
+
return 0;
}
More information about the Haiku-commits
mailing list