1 ///////////////////////////////////////////////////////////////////////////// 2 // Copyright (c) 2009-2014 Alan Wright. All rights reserved. 3 // Distributable under the terms of either the Apache License (Version 2.0) 4 // or the GNU Lesser General Public License. 5 ///////////////////////////////////////////////////////////////////////////// 6 7 #include "TestInc.h" 8 #include "MockLock.h" 9 10 namespace Lucene { 11 MockLock()12MockLock::MockLock() { 13 lockAttempts = 0; 14 } 15 ~MockLock()16MockLock::~MockLock() { 17 } 18 obtain()19bool MockLock::obtain() { 20 ++lockAttempts; 21 return true; 22 } 23 release()24void MockLock::release() { 25 // do nothing 26 } 27 isLocked()28bool MockLock::isLocked() { 29 return false; 30 } 31 toString()32String MockLock::toString() { 33 return L"MockLock"; 34 } 35 36 } 37