这篇教程C++ testRuleOnCode函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中testRuleOnCode函数的典型用法代码示例。如果您正苦于以下问题:C++ testRuleOnCode函数的具体用法?C++ testRuleOnCode怎么用?C++ testRuleOnCode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了testRuleOnCode函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: TESTTEST(ParameterReassignmentRuleTest, MultipleParameterReassignments){ testRuleOnCode(new ParameterReassignmentRule(), "void m(int a) { a = 1; a = 2; }", 0, 1, 17, 1, 21); testRuleOnCode(new ParameterReassignmentRule(), "void m(int a) { a = 1; a = 2; }", 1, 1, 24, 1, 28);}
开发者ID:DevenLu,项目名称:oclint,代码行数:7,
示例2: TEST_FTEST_F(NestedBlockDepthRuleTest, TwoLevelBlock){ testRuleOnCode(new NestedBlockDepthRule(), "void m() {{}}", 0, 1, 10, 1, 13, "Block depth of 2 exceeds limit of 0"); testRuleOnCode(new NestedBlockDepthRule(), "void m() {{}}", 1, 1, 11, 1, 12, "Block depth of 1 exceeds limit of 0");}
开发者ID:bliang,项目名称:oclint,代码行数:7,
示例3: TESTTEST(GotoStatementRuleTest, TwoGotos){ testRuleOnCode(new GotoStatementRule(), "void a(); void m() { goto A; goto B; A:/na();/nB:/na(); }", 0, 1, 22, 1, 27); testRuleOnCode(new GotoStatementRule(), "void a(); void m() { goto A; goto B; A:/na();/nB:/na(); }", 1, 1, 30, 1, 35);}
开发者ID:52doho,项目名称:oclint,代码行数:7,
示例4: TEST_FTEST_F(LongLineRuleTest, GetNumberOfCharactersForThreeLines){ testRuleOnCode(new LongLineRule(), "void m() {/n /n}", 0, 1, 1, 1, 10, "Line with 10 characters exceeds limit of 0"); testRuleOnCode(new LongLineRule(), "void m() {/n /n}", 1, 2, 1, 2, 2, "Line with 2 characters exceeds limit of 0"); testRuleOnCode(new LongLineRule(), "void m() {/n /n}", 2, 3, 1, 3, 1, "Line with 1 characters exceeds limit of 0");}
开发者ID:syc4101010,项目名称:oclint,代码行数:9,
示例5: TEST_FTEST_F(PreferEarlyExitRuleTest, LongIfAndReturnInsideBlock){ std::string code = "int test(int a) {/n"; code += " int i = 2;/n"; code += " if (a) {/n"; code += filler("i *= 2;/n", 2); code += " }/n"; code += " return i;/n"; code += "}/n"; testRuleOnCode(new PreferEarlyExitRule(), code, 0, 3, 3, 6, 3, PreferEarlyExitRule::getMessage());}
开发者ID:dreamsxin,项目名称:oclint,代码行数:12,
示例6: TEST_FTEST_F(LongMethodRuleTest, TweLines){ testRuleOnCode(new LongMethodRule(), "void aMethod() {/n}", 0, 1, 1, 2, 1, "Method with 2 lines exceeds limit of 0");}
开发者ID:syc4101010,项目名称:oclint,代码行数:5,
示例7: TEST_FTEST_F(NestedBlockDepthRuleTest, DoStatement){ testRuleOnCode(new NestedBlockDepthRule(), "void m() { do {} while(1); }", 0, 1, 10, 1, 28, "Block depth of 2 exceeds limit of 1");}
开发者ID:syc4101010,项目名称:oclint,代码行数:5,
示例8: TESTTEST(RedundantIfStatementRuleTest, CIntDeclaration){ testRuleOnCode(new RedundantIfStatementRule(), "void aMethod() { int b; if (1) { b = 6; } else b = 0; }");}
开发者ID:Abioy,项目名称:oclint,代码行数:5,
示例9: TESTTEST(UnusedMethodParameterRuleTest, FunctionDeclarationWithoutDefincationShouldBeIgnored){ testRuleOnCode(new UnusedMethodParameterRule(), "int aMethod(int a);");}
开发者ID:bliang,项目名称:oclint,代码行数:4,
示例10: TESTTEST(RedundantConditionalOperatorRuleTest, GoodConditionalOperator){ testRuleOnCode(new RedundantConditionalOperatorRule(), "void m(int a, int b) { int c = a > b ? a : b; }");}
开发者ID:bliang,项目名称:oclint,代码行数:4,
示例11: TESTTEST(ConstantIfExpressionRuleTest, testOnlyEvaluateTheNecessaryCondition){ testRuleOnCode(new ConstantIfExpressionRule(), "int foo() { return 1; } void aMethod() { if (1 ? 0 : foo()) {;} }", 0, 1, 46, 1, 58);}
开发者ID:52doho,项目名称:oclint,代码行数:5,
示例12: TESTTEST(EmptyForStatementRuleTest, ForStatementWithEmptyComponent){ testRuleOnCode(new EmptyForStatementRule(), "void aMethod() { for (;;) {} }", 0, 1, 27, 1, 28);}
开发者ID:syc4101010,项目名称:oclint,代码行数:5,
注:本文中的testRuleOnCode函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ testRuleOnObjCCode函数代码示例 C++ testNs函数代码示例 |