Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
velicuvlad committed Oct 4, 2024
1 parent b850ea6 commit 8df333b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Objective-C/Tests/VectorSearchTest+Lazy.m
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ - (void) testIndexUpdaterIndexOutOfBounds {
}

/**
* 26. TestIndexUpdaterCallFinishTwice
* 26. TestIndexUpdaterCallFinishTwice + 27. TestIndexUpdaterUseAfterFinished
*
* Description
* Test that when calling IndexUpdater's finish() after it was finished,
Expand All @@ -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;
Expand All @@ -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];
}];
Expand All @@ -1283,11 +1288,6 @@ - (void) testIndexUpdaterCallFinishTwice {
[self expectException: @"NSInternalInconsistencyException" in:^{
[updater skipVectorAtIndex: 0];
}];

[self expectException: @"NSInternalInconsistencyException" in:^{
NSError* outError;
[updater finishWithError: &outError];
}];
}

@end

0 comments on commit 8df333b

Please sign in to comment.