小编hoo*_*omi的帖子

在Swift中单元测试我自己的ViewController时,使用未声明类型的'ViewController'?

我一直在尝试在Swift中编写测试用例来测试我的ViewController.但是,当我尝试在XCTestCase中实例化我自己的ViewController时,我得到"使用未声明的类型'ViewController'".(ViewController是我自己的UIViewController类的名称)

在此输入图像描述

还有其他人以前遇到过这个问题吗?我正在使用Xcode 6 beta 5

xctest swift

24
推荐指数
1
解决办法
2万
查看次数

关于使用AndroidJunitRunner和AndroidJUnit4的Android Instrumentation测试java.lang.UnsatisfiedLinkError

我在单元测试中使用robolectric.最近在我们的项目中,我们正在添加zendesk的新依赖项.

repositories {

    maven {
        url 'https://zendesk.artifactoryonline.com/zendesk/repo'
    }
}

compile group: 'com.zendesk', name: 'sdk', version: '1.3.0.1'
Run Code Online (Sandbox Code Playgroud)

现在我们甚至都没有引用这个库中的任何类,我们只是通过添加这个依赖项来获取robolectric单元测试中的异常.我认为问题出在我们的项目中,但它也发生在样本robolectric测试项目上.

java.lang.VerifyError: Expecting a stackmap frame at branch target 31
Exception Details:
  Location:
    com/zendesk/sdk/power/BatteryStateBroadcastReceiver.onReceive(Landroid/content/Context;Landroid/content/Intent;)
V @13: ifnonnull
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0x0000000: b200 1212 0703 bd00 0fb8 0015 2cc7 0012
    0x0000010: b200 1212 0303 bd00 0fb8 0017 a700 66b2
    0x0000020: 0012 bb00 1159 b700 1c12 04b6 001d 2cb6
    0x0000030: 0014 b600 1db6 001e 03bd 000f b800 1512
    0x0000040: 062c b600 …
Run Code Online (Sandbox Code Playgroud)

java junit android unit-testing robolectric

5
推荐指数
1
解决办法
1042
查看次数

标签 统计

android ×1

java ×1

junit ×1

robolectric ×1

swift ×1

unit-testing ×1

xctest ×1