//
// GHTestMacros.h
//
// Created by Gabriel Handford on 1/17/09.
// Copyright 2009. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
//
// Portions of this file fall under the following license, marked with
// SENTE_BEGIN - SENTE_END
//
// Copyright (c) 1997-2005, Sen:te (Sente SA). All rights reserved.
//
// Use of this source code is governed by the following license:
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// (1) Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// (2) Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL Sente SA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Note: this license is equivalent to the FreeBSD license.
//
// This notice may not be removed from this file.
//
// Portions of this file fall under the following license, marked with:
// GTM_BEGIN : GTM_END
//
// Copyright 2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
//
/*!
@file GHTestMacros.h
@brief Assert macros for testing.
*/
#import "NSException+GHTestFailureExceptions.h"
#import "NSValue+GHValueFormatter.h"
// GTM_BEGIN
extern NSString *const GHTestFilenameKey;
extern NSString *const GHTestLineNumberKey;
extern NSString *const GHTestFailureException;
#if defined(__cplusplus)
extern "C"
#endif
NSString *GHComposeString(NSString *, ...);
/*!
Generates a failure when a1 != noErr
@param a1 Should be either an OSErr or an OSStatus
@param description A format string as in the printf() function. Can be nil or an empty string but must be present.
@param ...: A variable number of arguments to the format string. Can be absent.
*/
#define GHAssertNoErr(a1, description, ...) \
do { \
@try {\
OSStatus a1value = (a1); \
if (a1value != noErr) { \
NSString *_expression = [NSString stringWithFormat:@"Expected noErr, got %ld for (%s)", a1value, #a1]; \
if (description) { \
_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
} \
[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:_expression]]; \
} \
}\
@catch (id anException) {\
[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat:@"(%s) == noErr fails", #a1] \
exception:anException \
inFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
/*!
Generates a failure when a1 != a2
@param a1 Rreceived value. Should be either an OSErr or an OSStatus
@param a2 Expected value. Should be either an OSErr or an OSStatus
@param description A format string as in the printf() function. Can be nil or an empty string but must be present.
@param ... A variable number of arguments to the format string. Can be absent.
*/
#define GHAssertErr(a1, a2, description, ...) \
do { \
@try {\
OSStatus a1value = (a1); \
OSStatus a2value = (a2); \
if (a1value != a2value) { \
NSString *_expression = [NSString stringWithFormat:@"Expected %s(%ld) but got %ld for (%s)", #a2, a2value, a1value, #a1]; \
if (description) { \
_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
} \
[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:_expression]]; \
} \
}\
@catch (id anException) {\
[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat:@"(%s) == (%s) fails", #a1, #a2] \
exception:anException \
inFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
/*!
Generates a failure when a1 is NULL
@param a1 Should be a pointer (use GHAssertNotNil for an object)
@param description A format string as in the printf() function. Can be nil or an empty string but must be present.
@param ... A variable number of arguments to the format string. Can be absent.
*/
#define GHAssertNotNULL(a1, description, ...) \
do { \
@try {\
const void* a1value = (a1); \
if (a1value == NULL) { \
NSString *_expression = [NSString stringWithFormat:@"(%s) != NULL", #a1]; \
if (description) { \
_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
} \
[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:_expression]]; \
} \
}\
@catch (id anException) {\
[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat:@"(%s) != NULL fails", #a1] \
exception:anException \
inFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
/*!
Generates a failure when a1 is not NULL
@param a1 should be a pointer (use GHAssertNil for an object)
@param description A format string as in the printf() function. Can be nil or an empty string but must be present.
@param ... A variable number of arguments to the format string. Can be absent.
*/
#define GHAssertNULL(a1, description, ...) \
do { \
@try {\
const void* a1value = (a1); \
if (a1value != NULL) { \
NSString *_expression = [NSString stringWithFormat:@"(%s) == NULL", #a1]; \
if (description) { \
_expression = [NSString
没有合适的资源?快使用搜索试试~ 我知道了~
iOS游戏应用源代码——samsoffes-sstoolkit-1.0.1-7-g1910416.zip
共186个文件
h:72个
m:59个
png:25个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 182 浏览量
2023-07-05
23:23:31
上传
评论
收藏 1.14MB ZIP 举报
温馨提示
iOS游戏应用源代码——samsoffes-sstoolkit-1.0.1-7-g1910416.zip
资源推荐
资源详情
资源评论
收起资源包目录
iOS游戏应用源代码——samsoffes-sstoolkit-1.0.1-7-g1910416.zip (186个子文件)
GHUnitIOS 2.08MB
.gitignore 97B
GHTestMacros.h 40KB
SSCollectionView.h 29KB
GHUnit.h 22KB
SSWebView.h 12KB
SSCollectionViewItem.h 6KB
NSString+SSToolkitAdditions.h 6KB
GHTest.h 5KB
GHTestGroup.h 5KB
GHTestRunner.h 5KB
GHAsyncTestCase.h 4KB
NSException+GHTestFailureExceptions.h 4KB
GHTestCase.h 4KB
GHTesting.h 4KB
GHTestSuite.h 4KB
SSAnimatedImageView.h 4KB
UIImage+SSToolkitAdditions.h 4KB
SSBadgeView.h 3KB
NSValue+GHValueFormatter.h 3KB
NSDate+SSToolkitAdditions.h 3KB
SSDrawingUtilities.h 2KB
NSDictionary+SSToolkitAdditions.h 2KB
UIColor+SSToolkitAdditions.h 2KB
NSArray+SSToolkitAdditions.h 2KB
GHUnitIPhoneViewController.h 2KB
SSTextField.h 2KB
UIApplication+SSToolkitAdditions.h 2KB
UIView+SSToolkitAdditions.h 2KB
SSRatingPicker.h 2KB
SSGradientView.h 2KB
SSLineView.h 2KB
GHUnitIPhoneView.h 2KB
NSURL+SSToolkitAdditions.h 2KB
SSCategories.h 2KB
GHTestOperation.h 1KB
GHUnitIPhoneTestViewController.h 1KB
GHUnitIPhoneTableViewDataSource.h 1KB
GHTest+JUnitXML.h 1KB
SSPieProgressView.h 1KB
GHTestGroup+JUnitXML.h 1KB
GHUnitIPhoneAppDelegate.h 1KB
SSRateLimit.h 1KB
UIScreen+SSToolkitAdditions.h 1KB
SSLabel.h 1KB
SSHUDView.h 1KB
SSToolkit.h 1KB
NSData+SSToolkitAdditions.h 1KB
SSRatingPickerViewController.h 1KB
SSBorderedView.h 1016B
SSConcurrentOperation.h 990B
SSToolkitDefines.h 979B
SSPickerViewController.h 839B
SSLoadingView.h 748B
UIViewController+SSToolkitAdditions.h 656B
UIScrollView+SSToolkitAdditions.h 647B
UIControl+SSToolkitAdditions.h 604B
UIDevice+SSToolkitAdditions.h 588B
SSTextView.h 574B
SSCollectionViewItemTableViewCell.h 530B
SSCollectionViewController.h 522B
SSRatingPickerScrollView.h 516B
NSNumber+SSToolkitAdditions.h 498B
SSBadgeTableViewCell.h 424B
SSAddressBarTextField.h 388B
NSBundle+SSToolkitAdditions.h 356B
SSCollectionViewTableView.h 353B
SSCollectionViewExtremityTableViewCell.h 348B
SSCollectionViewItemInternal.h 346B
SSButton.h 336B
SSAddressBarTextFieldBackgroundView.h 280B
SSCollectionViewInternal.h 278B
SSHUDWindow.h 256B
SSAddressBarTextFieldBackgroundViewInnerView.h 234B
LICENSE 1KB
SSCollectionView.m 33KB
SSWebView.m 10KB
SSHUDView.m 10KB
NSString+SSToolkitAdditions.m 8KB
StringCategoryTest.m 7KB
NSDate+SSToolkitAdditions.m 6KB
SSRatingPicker.m 5KB
SSBadgeView.m 5KB
SSCollectionViewItem.m 5KB
NSData+SSToolkitAdditions.m 4KB
SSAnimatedImageView.m 4KB
SSDrawingUtilities.m 4KB
SSRatingPickerScrollView.m 4KB
SSGradientView.m 3KB
SSAddressBarTextField.m 3KB
GHUnitIOSTestMain.m 3KB
UIColor+SSToolkitAdditions.m 3KB
DataCategoryTest.m 3KB
SSPieProgressView.m 3KB
ColorCategoryTest.m 3KB
SSLoadingView.m 3KB
SSPickerViewController.m 3KB
DictionaryCategoryTest.m 2KB
SSLineView.m 2KB
NSDictionary+SSToolkitAdditions.m 2KB
共 186 条
- 1
- 2
资源评论
快乐无限出发
- 粉丝: 0
- 资源: 7303
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功