mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			55 lines
		
	
	
		
			984 B
		
	
	
	
		
			Matlab
		
	
		
		
			
		
	
	
			55 lines
		
	
	
		
			984 B
		
	
	
	
		
			Matlab
		
	
| 
											7 years ago
										 | // | ||
|  | //  Copyright (c) 2018 Open Whisper Systems. All rights reserved. | ||
|  | // | ||
|  | 
 | ||
| 
											7 years ago
										 | #import "SSKBaseTestObjC.h" | ||
| 
											7 years ago
										 | #import "OWSPrimaryStorage.h" | ||
|  | #import "SSKEnvironment.h" | ||
|  | #import "TestAppContext.h" | ||
|  | 
 | ||
|  | NS_ASSUME_NONNULL_BEGIN | ||
|  | 
 | ||
| 
											7 years ago
										 | #ifdef DEBUG | ||
|  | 
 | ||
| 
											7 years ago
										 | @implementation SSKBaseTestObjC | ||
| 
											7 years ago
										 | 
 | ||
|  | - (void)setUp | ||
|  | { | ||
|  |     NSLog(@"%@ setUp", self.logTag); | ||
|  | 
 | ||
|  |     [super setUp]; | ||
|  | 
 | ||
|  |     ClearCurrentAppContextForTests(); | ||
|  |     SetCurrentAppContext([TestAppContext new]); | ||
| 
											7 years ago
										 | 
 | ||
|  |     [MockSSKEnvironment activate]; | ||
| 
											7 years ago
										 | } | ||
|  | 
 | ||
|  | - (void)tearDown | ||
|  | { | ||
|  |     NSLog(@"%@ tearDown", self.logTag); | ||
|  | 
 | ||
|  |     [super tearDown]; | ||
|  | } | ||
|  | 
 | ||
| 
											7 years ago
										 | - (void)readWithBlock:(void (^)(YapDatabaseReadTransaction *transaction))block | ||
|  | { | ||
|  |     OWSAssert(block); | ||
|  | 
 | ||
|  |     [[SSKEnvironment.shared.primaryStorage newDatabaseConnection] readWithBlock:block]; | ||
|  | } | ||
|  | 
 | ||
|  | 
 | ||
|  | - (void)readWriteWithBlock:(void (^)(YapDatabaseReadWriteTransaction *transaction))block | ||
|  | { | ||
|  |     OWSAssert(block); | ||
|  | 
 | ||
|  |     [[SSKEnvironment.shared.primaryStorage newDatabaseConnection] readWriteWithBlock:block]; | ||
|  | } | ||
|  | 
 | ||
| 
											7 years ago
										 | @end | ||
|  | 
 | ||
| 
											7 years ago
										 | #endif | ||
|  | 
 | ||
| 
											7 years ago
										 | NS_ASSUME_NONNULL_END |