From b551f080468996fc3c2e9dd856b0c103c9548f91 Mon Sep 17 00:00:00 2001 From: Vlad Velicu Date: Wed, 22 Jan 2025 21:45:24 +0000 Subject: [PATCH] removed unused method and 1 redundant test --- Objective-C/Tests/LogTest.m | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/Objective-C/Tests/LogTest.m b/Objective-C/Tests/LogTest.m index 9face49e0..6c8cd5470 100644 --- a/Objective-C/Tests/LogTest.m +++ b/Objective-C/Tests/LogTest.m @@ -94,22 +94,6 @@ - (void) writeAllLogs: (NSString*)string { CBLWarnError(Database, @"%@", string); } -- (BOOL) isKeywordPresentInAnyLog: (NSString*)keyword path: (nullable NSString*)path { - if (!path) return NO; - NSArray* files = [self getLogsInDirectory: path properties: nil onlyInfoLogs: NO]; - NSError* error; - for (NSURL* url in files) { - NSString* contents = [NSString stringWithContentsOfURL: url - encoding: NSASCIIStringEncoding - error: &error]; - AssertNil(error); - if ([contents rangeOfString: keyword].location != NSNotFound) { - return YES; - } - } - return NO; -} - - (void) testCustomLoggingLevels { CBLLogInfo(Database, @"IGNORE"); CustomLogger* customLogger = [[CustomLogger alloc] init]; @@ -282,22 +266,14 @@ - (void) testFileLoggingMaxSize { AssertEqual(files.count, totalFilesShouldBeInDirectory); } -- (void) testFileLoggingDisabled { - CBLLogSinks.file = nil; - - NSString* inputString = [[NSUUID UUID] UUIDString]; - [self writeAllLogs: inputString]; - - AssertFalse([self isKeywordPresentInAnyLog: inputString path: CBLLogSinks.file.directory]); -} - - (void) testFileLoggingReEnableLogging { CBLLogSinks.file = nil; + AssertNil(CBLLogSinks.file.directory); NSString* inputString = [[NSUUID UUID] UUIDString]; [self writeAllLogs: inputString]; - AssertFalse([self isKeywordPresentInAnyLog: inputString path: CBLLogSinks.file.directory]); + AssertNil(CBLLogSinks.file.directory); CBLLogSinks.file = [[CBLFileLogSink alloc] initWithLevel: kCBLLogLevelVerbose directory: logFileDirectory