iOS4 ve Xcode 4/SDK4.3 ile birim ve uygulama testleri için OCMock 1.77 kullanmaya çalışıyorum. OCMock kullanarak statik kütüphane olarak kullanmak için şu adımları takip ettim: http://www.mulle-kybernetik.com/software/OCMock/. Birim ve uygulama testleri OCMock olmadan çalışır.iOS4 ve Xcode 4/SDK4.3 ile Birim ve Uygulama Testi için OCMock 1,77 Kullanımı
OCMock'u eklediğimde ve simülatör (birim testleri) için OCMock'un test paketini çalıştırmayı denediğimde, test donanımım 134 koduyla çöküyor. Test donanımı bir aygıt için iyi çalışıyor (uygulama testleri). Konsola baktığımda aşağıdaki iletiyi görüyorum. Bu, yukarıdaki URL’deki talimatlara göre -force_load bağlayıcı bayrağını eklemediğimi gösterir. Ama benim ... Düşüncelerim var mı?
Şuna baktım: Test rig exited abnormally with code 134 with OCMock verify on iOS 4 bu davranışın bir hata olduğunu gösterir - ancak OCMock test paketini çalıştırdığımdan beri aynı durum olduğundan emin değilim. Bu bir hata ise, birim testinde alay kullanmak için bir çalışma var mı?
TIA.
=====
Konsol çıkışı:
3/30/11 1:02:32 AM otest[38552] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '** Expected method not present; the method getArgumentAtIndexAsObject: is not implemented by NSInvocation. If you see this exception it is likely that you are using the static library version of OCMock and your project is not configured correctly to load categories from static libraries. Did you forget to add the -force_load linker flag?'
*** Call stack at first throw:
(
0 CoreFoundation 0x004a05a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x002cf313 objc_exception_throw + 44
2 CoreFoundation 0x00458ef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00458e6a +[NSException raise:format:] + 58
4 LogicTests 0x00f89de4 +[OCMockObject initialize] + 115
5 libobjc.A.dylib 0x002cfd9b _class_initialize + 380
6 libobjc.A.dylib 0x002d773f prepareForMethodLookup + 73
7 libobjc.A.dylib 0x002ce069 lookUpMethod + 86
8 libobjc.A.dylib 0x002ce1d6 _class_lookupMethodAndLoadCache + 40
9 libobjc.A.dylib 0x002e10e3 objc_msgSend + 87
10 SenTestingKit 0x20108824 +[NSObject(SenTestRuntimeUtilities) senAllSubclasses] + 107
11 SenTestingKit 0x201074a7 +[SenTestSuite updateCache] + 39
12 SenTestingKit 0x20107443 +[SenTestSuite suiteForBundleCache] + 92
13 SenTestingKit 0x201073a4 +[SenTestSuite testSuiteForBundlePath:] + 108
14 SenTestingKit 0x2010606b +[SenTestProbe specifiedTestSuite] + 332
15 SenTestingKit 0x20106792 +[SenTestProbe runTests:] + 156
16 otest 0x000023c7 0x0 + 9159
17 otest 0x000025f2 0x0 + 9714
18 otest 0x0000209a 0x0 + 8346
19 otest 0x00002049 0x0 + 8265
)
bayrakları test hedefine doğru ayarlanır. Bir test vakası bile oluşturmadan önce ünite test hedefi çöküyor - bu yüzden sadece şifreli bir onaylama hatası değil. – Erik
Bu hatanın bu soruna neden olduğuna eminim: http://openradar.appspot.com/8081169 – Erik
Bu hata, yukarıdaki yığın izlemenin nedeni değil. Bu hata, istisnanın yakalanamamasıyla ilgilidir - OCMock bağlamında, OCMock başarısızlığı yakalayamadığı ve sardığı için doğrulama hatasının istenen bir hatadan daha az olduğu anlamına gelir. –