草庐IT

constant_test

全部标签

android - 测试运行失败 : Test run failed to complete. 预期 1 次测试,收到 0

我尝试为我的应用启动JUnit测试(robotium):publicclassMainTestextendsActivityInstrumentationTestCase2{privateSolosolo;publicMainTest(){super("nix.android.contact",MainActivity.class);//TODOAuto-generatedconstructorstub}protectedvoidsetUp()throwsException{super.setUp();solo=newSolo(getInstrumentation(),getActiv

android - 找不到错误 :resource style/TextAppearance. Compat.Notification.Info(又名 {packageId}.test :style/TextAppearance. Compat.Notification.Info)

我刚刚将build.gradle编译SDK更新为27API。compileSdkVersion27buildToolsVersion'27.0.3'targetSdkVersion27但是一旦我点击同步按钮它就​​会抛出error:resourcestyle/TextAppearance.Compat.Notification.Info(aka{packageId}.test:style/TextAppearance.Compat.Notification.Info)notfound.error:resourcestyle/TextAppearance.Compat.Notificat

android - 在 Android Studio 项目上找不到参数的方法 test()

在我的Android应用程序中,我想在包中排除一些测试用例,以便我在build.gradle文件中使用test任务。例如:applyplugin:'com.android.library'test{exclude'**/calltest/Summary.class'}如果同步项目我得到以下异常:*Whatwentwrong:Aproblemoccurredevaluatingproject':SdkModule'.>Couldnotfindmethodtest()forarguments[build_4g3vf7b615x3x1p7i9ty0pt1l$_run_closure1@73d

android - 多模块 Android 项目中的全局代码覆盖率 : merge code coverage reports (Unit & UI tests)

我有一个由2个模块组成的Android应用:应用-用户界面子模块-具有大部分业务逻辑对于它们中的每一个,我都有一个gradle任务来验证代码覆盖率:应用:UI代码覆盖率(Espresso)子模块:单元测试代码覆盖率作为客户的要求,我需要合并这两个报告以获得应用程序的整体/全局代码覆盖率。注意:我使用的是Gradle版本3.1.2。应用程序Gradle文件:applyplugin:'jacoco'android{testBuildType"uiTest"...buildTypes{debug{applicationIdSuffix".debug"versionNameSuffix"-de

android - MultiDexTestRunner 的哪个包? android.support.multidex 或 com.android.test.runner

页面http://developer.android.com/tools/building/multidex.html#testing建议dependencies{compile'com.android.support:multidex:1.0.1'androidTestCompile'com.android.support:multidex-instrumentation:1.0.1'}android{defaultConfig{multiDexEnabledtruetestInstrumentationRunner"android.support.multidex.MultiDex

Android Gradle 应用程序 :connectedCheck runs tests from dependencies

我有一些图书馆项目有自己的测试。我不负责这个库项目,也不关心它的测试,但是,当我运行gradle:app:connectedCheck时,它会运行我的测试,但它也会运行依赖项的测试。有什么办法可以防止这种情况发生吗?我应该提一下,我的依赖项不在我所说的app模块中。编辑:更具体地说,我所依赖的库项目有非常长的测试,因为它们打算在凌晨2点在构建服务器上运行,所以我坐在这里等待油漆干燥只是为了运行我的测试很短。EDIT2:我也尝试过使用Spoon。我现在已经设置好并且可以运行单独的类,但我想在一个包中运行所有内容。这可能吗?EDIT3:文件夹结构无关紧要,但这里有一个非常非常不详细的外观:

c++ - 在 "test mode"中打印信息,但不在 "normal execution"中打印信息

我正在使用c++中的应用程序,它使用特殊的dprintf函数来打印信息,这是一个示例:dprintf(verbose,"Thevalueis:%d",i);我正在做的是,当我出于测试目的定义冗长然后打印信息时,当我在正常执行中工作时我没有定义它并且我没有在屏幕上看到无用的信息。我的问题是如何执行该功能或实现相同的想法? 最佳答案 我尽量避免使用var-argC风格的函数,主要原因有两个:它们不是类型安全的,不能使用运算符他们无法识别何时提供的论点太少或太多我创建了一种使用boost::fusion的方法,它以类型安全的方式提供参数。

c++ - C 编译错误 : stray '\200' in program and expected ')' before numeric constant

我复制了这个程序,但在使用voiddownFrequency函数时遇到了问题(我认为)。这是给ArduinoUno的.以下是编译器错误:为“ArduinoUno”编译“MY_dds”MY_dds.ino:stray'\342'inprogramMY_dds.ino:stray'\200'inprogramMY_dds.ino:stray'\223'inprogramMY_dds.ino:stray'\342'inprogramMY_dds.ino:stray'\200'inprogramMY_dds.ino:stray'\223'inprogramMY_dds.ino:stray'\3

c++ - integral_constant 与 constexpr

您能否解释一下,为什么以下示例中的integral_constant和constexpr方法会导致不同的行为?#includeusingnamespacestd;structLogger{//template//usingIsRawString=//std::integral_constant::value||std::is_same::value>;templateconstexprboolIsRawString(){returnstd::is_same::value||std::is_same::value;}templatestructTraits{staticconstintI

c++ - cppcheck 认为我有 "Redundant code: Found a statement that begins with numeric constant"

Cppcheck(version1.46.1)对像这样的枚举发出以下警告:enumDATABASE_TYPE{DATABASE_TYPE_UNKNOWN=-1,//Redundantcode:Foundastatementthatbeginswithnumericconstant我不认为这是多余的。能够做那样的事情非常重要。这是cppcheck的错误还是我没有看到什么?更新我设法将它归结为一个最小的例子。这因为cppcheck有2个(更多)错误而变得复杂,这使得我的减少看起来没有效果。共有5个文件:a.h、a.cpp、b.h、b.cpp和inc。h包含以下内容。VC9在没有警告的情况下