Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Merge branch 'develop' into release/4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Scholtysik (Reimold) committed Dec 8, 2016
2 parents 838db35 + f15a19e commit 9f45012
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 23 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode7.2
osx_image: xcode8.1

env:
global:
Expand All @@ -10,15 +10,14 @@ env:
matrix:
- SCHEME="HockeySDK" DESTINATION="OS=9.0,name=Apple TV 1080p" RUN_TESTS="YES"
- SCHEME="HockeySDK" DESTINATION="OS=9.1,name=Apple TV 1080p" RUN_TESTS="YES"
- SCHEME="HockeySDK Framework" DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p" RUN_TESTS="YES"
- SCHEME="HockeySDK Framework" DESTINATION="platform=tvOS Simulator,OS=9.1,name=Apple TV 1080p" RUN_TESTS="YES"
- SCHEME="HockeySDK Distribution" RUN_TESTS="NO" LINT="YES"

before_install:
- xcrun simctl list
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty-travis-formatter --no-rdoc --no-ri --no-document --quiet
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- brew install carthage

script:
- open -b com.apple.iphonesimulator
Expand Down
17 changes: 11 additions & 6 deletions Classes/BITChannel.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#import "BITChannel.h"
#import "HockeySDKFeatureConfig.h"

#if HOCKEYSDK_FEATURE_METRICS

#import "HockeySDKPrivate.h"
#import "BITChannelPrivate.h"
#import "BITHockeyHelper.h"
#import "BITTelemetryContext.h"
Expand Down Expand Up @@ -234,17 +235,21 @@ - (void)startTimer {

self.timerSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self.dataItemsOperations);
dispatch_source_set_timer(self.timerSource, dispatch_walltime(NULL, NSEC_PER_SEC * self.batchInterval), 1ull * NSEC_PER_SEC, 1ull * NSEC_PER_SEC);

__weak typeof(self) weakSelf = self;
dispatch_source_set_event_handler(self.timerSource, ^{
typeof(self) strongSelf = weakSelf;

if (strongSelf->_dataItemCount > 0) {
[strongSelf persistDataItemQueue];
} else {
strongSelf.channelBlocked = NO;
if(strongSelf) {
if (strongSelf->_dataItemCount > 0) {
[strongSelf persistDataItemQueue];
} else {
strongSelf.channelBlocked = NO;
}
[strongSelf invalidateTimer];
}
[strongSelf invalidateTimer];
});

dispatch_resume(self.timerSource);
}

Expand Down
28 changes: 27 additions & 1 deletion Support/HockeySDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@
attributes = {
LastSwiftUpdateCheck = 0730;
LastTestingUpgradeCheck = 0600;
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0810;
TargetAttributes = {
1EB6173E1B0A30480035A986 = {
CreatedOnToolsVersion = 6.3.1;
Expand Down Expand Up @@ -2116,13 +2116,23 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMPRESS_PNG_FILES = NO;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"BITHOCKEY_STATIC_LIBRARY=1",
Expand All @@ -2132,11 +2142,14 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist";
ONLY_ACTIVE_ARCH = YES;
Expand All @@ -2152,22 +2165,35 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMPRESS_PNG_FILES = NO;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"BITHOCKEY_STATIC_LIBRARY=1",
"$(inherited)",
);
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist";
RUN_CLANG_STATIC_ANALYZER = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
16 changes: 10 additions & 6 deletions Support/HockeySDKTests/BITChannelTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ - (void)setUp {
BITTelemetryContext *mockContext = mock(BITTelemetryContext.class);

_sut = [[BITChannel alloc]initWithTelemetryContext:mockContext persistence:_mockPersistence];
BITSafeJsonEventsString = NULL;
bit_resetSafeJsonStream(&BITSafeJsonEventsString);
}

#pragma mark - Setup Tests
Expand Down Expand Up @@ -87,14 +87,16 @@ - (void)testAppendStringToSafeJsonStream {
#pragma clang diagnostic ignored "-Wnonnull"
bit_appendStringToSafeJsonStream(nil, 0);
#pragma clang diagnostic pop
XCTAssertTrue(BITSafeJsonEventsString == NULL);
XCTAssertEqual(strcmp(BITSafeJsonEventsString,""), 0);

// BITSafeJsonEventsString = NULL;
bit_resetSafeJsonStream(&BITSafeJsonEventsString);

BITSafeJsonEventsString = NULL;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"
bit_appendStringToSafeJsonStream(nil, &BITSafeJsonEventsString);
#pragma clang diagnostic pop
XCTAssertTrue(BITSafeJsonEventsString == NULL);
XCTAssertEqual(strcmp(BITSafeJsonEventsString,""), 0);

bit_appendStringToSafeJsonStream(@"", &BITSafeJsonEventsString);
XCTAssertEqual(strcmp(BITSafeJsonEventsString,""), 0);
Expand All @@ -107,12 +109,14 @@ - (void)testResetSafeJsonStream {
bit_resetSafeJsonStream(&BITSafeJsonEventsString);
XCTAssertEqual(strcmp(BITSafeJsonEventsString,""), 0);

BITSafeJsonEventsString = NULL;
// BITSafeJsonEventsString = NULL;
bit_resetSafeJsonStream(&BITSafeJsonEventsString);

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"
bit_resetSafeJsonStream(nil);
#pragma clang diagnostic pop
XCTAssertEqual(BITSafeJsonEventsString, NULL);
XCTAssertEqual(strcmp(BITSafeJsonEventsString,""), 0);

BITSafeJsonEventsString = strdup("test string");
bit_resetSafeJsonStream(&BITSafeJsonEventsString);
Expand Down
2 changes: 1 addition & 1 deletion Support/HockeySDKTests/BITMetricsManagerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ - (void)testNewSessionUpdatesSessionContext {
OCMVerifyAll(mockContext);
}

@end
@end

0 comments on commit 9f45012

Please sign in to comment.