同じコンパイラ エラーが発生しました。
internal compiler error: tree check: expected tree that contains 'decl with visibility' structure, have 'const_decl' in c_common_truthvalue_conversion, at c-common.c:2836
iOS デバイス用にビルドする場合、GHUnitIOS-0.4.32 (および GHUnitIOS-0.4.31) で Xcode 4.1 を使用します。シミュレータ用にビルドする場合は問題がないことに注意してください。
コンパイラ エラーには、GHAssertNotEqualObjects
およびの呼び出しが含まれていGHAssertNotEquals
ました。
コンパイラ エラーを受け取ったときに使用していたコード パターンは次のとおりです。
- (void) test_isEqual {
SomeObject *foo = [[SomeObject alloc] initWithValue: 1];
SomeObject *bar = [[SomeObject alloc] initWithValue: 2];
GHAssertNotEquals(bar, foo, @"Different Objects, different values - different pointers");
GHAssertNotEqualObjects(bar, foo, @"Different Objects, different values - different pointers (calls isEqual)");
}
次の変更を加えてコードをコンパイルできました。
- (void) test_isEqual {
NSString *comment;
SomeObject *foo = [[SomeObject alloc] initWithValue: 1];
SomeObject *bar = [[SomeObject alloc] initWithValue: 2];
comment = @"Different Objects, different values - different pointers";
GHAssertNotEquals(bar, foo, comment);
comment = @"Different Objects, different values - different pointers (calls isEqual)";
GHAssertNotEqualObjects(bar, foo, comment);
}
GHAssertEqualObjects
、GHAssertEqualStrings
、GHAssertEquals
、GHAssertFalse
、GHAssertNil
、GHAssertNotNil
およびGHAssertTrue
const NSString (つまり @"some string") を使用した呼び出しは、コンパイラ エラーを引き起こさなかったことに注意してください。
と の使用を調べる#define GHAssertNotEquals(a1, a2, description, ...)
と、どちらも を呼び出しますが、動作する他のマクロも同様です。#define GHAssertEqualObjects(a1, a2, description, ...)
description
GHComposeString(description, ##__VA_ARGS__)