2010/8/10 Kostka Bořivoj <kos...@tovek.cz>: > I added MockRAMDirectory ported by Veit into TestRAMDirectory and found > following: > > 1) sizeInBytes members in RAMDirectory and RAMFile aren’t correct, I > fixed this somehow, but I’m not sure if it shouldn’t be fixed different way, > could anybody look at it
The patch for RAMFile::getLength() seems correct. You will find the same line in the corresponding method of JLucene. For the patch of the RAMFile desctructor I'm in doubt. Looking at the correspondong JLucene classes subtracting the file size is done in the deleteFile method of RAMDirectory (see diff). By the way, I needed some inline keywords removed in _RAMDirectory.h. Otherwise, I couldn't compile it with gcc on FreeBSD. > 2) MockRAMDirectory::close always throws an exception because > segments.gen is in list of open files, no idea if this is a bug in > RAMDirectory or MockRAMDirectory Why do you use MockRAMDirectory here? I ported this class from JLucene, because I needed once a directory implementation that intentionally throws exceptions. And because the close-methods of RAMDirectory and MockRAMDirectory are identical to the JLucene methods, I'd say that's neither a bug of RAMDirectory nor MockRAMDirectory. > 3) Also fixed few things in MockRAMDirectory (Veit, can you look at it > in intensive_testing branch?) Regarding LCG: Seems fine. Wasn't aware of that. Regarding maxSize: Seems fine. But there isn't a similar initialisation in the JLucene class. Maybe by intention. Veit
_RAMDirectory.h.diff
Description: Binary data
RAMDirectory.cpp.diff
Description: Binary data
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ CLucene-developers mailing list CLucene-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/clucene-developers