Enable experiment in tests

This commit is contained in:
Huy Nguyen
2019-06-28 12:05:56 -07:00
parent f1296a821f
commit 8a5e16bfce
6 changed files with 51 additions and 5 deletions
@@ -34,6 +34,11 @@
- (void)setUp {
[super setUp];
ASConfiguration *config = [ASConfiguration new];
config.experimentalFeatures = ASExperimentalOptimizeDataControllerPipeline;
[ASConfigurationManager test_resetWithConfiguration:config];
// Default is 2 sections: 2 items in first, 1 item in second.
sections = [NSMutableArray array];
[sections addObject:[ASTestSection new]];
+11 -1
View File
@@ -16,7 +16,9 @@
#import <OCMock/OCMock.h>
#import <AsyncDisplayKit/ASCollectionView+Undeprecated.h>
#import <AsyncDisplayKit/ASDisplayNode+FrameworkPrivate.h>
#import "ASDisplayNodeTestsHelper.h"
#import "ASTestCase.h"
@interface ASTextCellNodeWithSetSelectedCounter : ASTextCellNode
@@ -166,12 +168,20 @@
@end
@interface ASCollectionViewTests : XCTestCase
@interface ASCollectionViewTests : ASTestCase
@end
@implementation ASCollectionViewTests
- (void)setUp
{
[super setUp];
ASConfiguration *config = [ASConfiguration new];
config.experimentalFeatures = ASExperimentalOptimizeDataControllerPipeline;
[ASConfigurationManager test_resetWithConfiguration:config];
}
- (void)tearDown
{
// We can't prevent the system from retaining windows, but we can at least clear them out to avoid
+12 -1
View File
@@ -12,9 +12,10 @@
#import <AsyncDisplayKit/ASCollectionView.h>
#import <stdatomic.h>
#import "ASTestCase.h"
#import "ASThrashUtility.h"
@interface ASCollectionViewThrashTests : XCTestCase
@interface ASCollectionViewThrashTests : ASTestCase
@end
@@ -25,8 +26,18 @@
BOOL _failed;
}
- (void)setUp
{
[super setUp];
ASConfiguration *config = [ASConfiguration new];
config.experimentalFeatures = ASExperimentalOptimizeDataControllerPipeline;
[ASConfigurationManager test_resetWithConfiguration:config];
}
- (void)tearDown
{
[super tearDown];
if (_failed && _update != nil) {
NSLog(@"Failed update %@: %@", _update, _update.logFriendlyBase64Representation);
}
+2 -1
View File
@@ -59,7 +59,8 @@ static ASExperimentalFeatures features[] = {
];
}
- (ASExperimentalFeatures)allFeatures {
- (ASExperimentalFeatures)allFeatures
{
ASExperimentalFeatures allFeatures = 0;
for (int i = 0; i < sizeof(features)/sizeof(ASExperimentalFeatures); i++) {
allFeatures |= features[i];
+10 -1
View File
@@ -22,6 +22,7 @@
#import <AsyncDisplayKit/ASTableView+Undeprecated.h>
#import <AsyncDisplayKit/ASInternalHelpers.h>
#import "ASTestCase.h"
#import "ASXCTExtensions.h"
#define NumberOfSections 10
@@ -217,12 +218,20 @@
@end
@interface ASTableViewTests : XCTestCase
@interface ASTableViewTests : ASTestCase
@property (nonatomic, retain) ASTableView *testTableView;
@end
@implementation ASTableViewTests
- (void)setUp
{
[super setUp];
ASConfiguration *config = [ASConfiguration new];
config.experimentalFeatures = ASExperimentalOptimizeDataControllerPipeline;
[ASConfigurationManager test_resetWithConfiguration:config];
}
- (void)testDataSourceImplementsNecessaryMethods
{
ASTestTableView *tableView = [[ASTestTableView alloc] __initWithFrame:CGRectMake(0, 0, 100, 400)
+11 -1
View File
@@ -13,9 +13,10 @@
#import <AsyncDisplayKit/ASTableView+Undeprecated.h>
#import <stdatomic.h>
#import "ASTestCase.h"
#import "ASThrashUtility.h"
@interface ASTableViewThrashTests: XCTestCase
@interface ASTableViewThrashTests: ASTestCase
@end
@implementation ASTableViewThrashTests
@@ -27,8 +28,17 @@
#pragma mark Overrides
- (void)setUp
{
[super setUp];
ASConfiguration *config = [ASConfiguration new];
config.experimentalFeatures = ASExperimentalOptimizeDataControllerPipeline;
[ASConfigurationManager test_resetWithConfiguration:config];
}
- (void)tearDown
{
[super tearDown];
if (_failed && _update != nil) {
NSLog(@"Failed update %@: %@", _update, _update.logFriendlyBase64Representation);
}