From 8df333b53f1dc44ace48bb120e47c83b4ad4d350 Mon Sep 17 00:00:00 2001 From: Vlad Velicu Date: Fri, 4 Oct 2024 17:22:43 +0100 Subject: [PATCH] CBL-5899 --- Objective-C/Tests/VectorSearchTest+Lazy.m | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Objective-C/Tests/VectorSearchTest+Lazy.m b/Objective-C/Tests/VectorSearchTest+Lazy.m index edf5b6b22..1daec825c 100644 --- a/Objective-C/Tests/VectorSearchTest+Lazy.m +++ b/Objective-C/Tests/VectorSearchTest+Lazy.m @@ -1231,7 +1231,7 @@ - (void) testIndexUpdaterIndexOutOfBounds { } /** - * 26. TestIndexUpdaterCallFinishTwice + * 26. TestIndexUpdaterCallFinishTwice + 27. TestIndexUpdaterUseAfterFinished * * Description * Test that when calling IndexUpdater's finish() after it was finished, @@ -1250,10 +1250,10 @@ - (void) testIndexUpdaterIndexOutOfBounds { * - Convert the vector result which is an array object to a platform's float array. * - Call setVector() with the platform's float array at the index. * 4. Call finish() and check that the finish() is successfully called. - * 5. Call finish() again and check that a CouchbaseLiteException with the code NotOpen is thrown. + * 5. Call finish() again and check that it throws exception. * 6. Count, getValue, setVector, skipVector throw exception. */ -- (void) testIndexUpdaterCallFinishTwice { +- (void) testIndexUpdaterUseAfterFinished { [self createWordsIndexWithConfig: LAZY_VECTOR_INDEX_CONFIG(@"word", 300, 8)]; NSError* error; @@ -1267,6 +1267,11 @@ - (void) testIndexUpdaterCallFinishTwice { Assert([updater setVector: vector atIndex: 0 error: &error]); Assert([updater finishWithError: &error]); + [self expectException: @"NSInternalInconsistencyException" in:^{ + NSError* outError; + [updater finishWithError: &outError]; + }]; + [self expectException: @"NSInternalInconsistencyException" in:^{ [updater count]; }]; @@ -1283,11 +1288,6 @@ - (void) testIndexUpdaterCallFinishTwice { [self expectException: @"NSInternalInconsistencyException" in:^{ [updater skipVectorAtIndex: 0]; }]; - - [self expectException: @"NSInternalInconsistencyException" in:^{ - NSError* outError; - [updater finishWithError: &outError]; - }]; } @end