小编Ari*_*rif的帖子

在Mac OS中使用vim在单键击中编译和运行C++代码

我使用的是Mac OS X 10.6.8版.是否有任何有用的脚本使用单个命令从vim内部编译和运行我的c ++文件?

c++ vim osx-snow-leopard

3
推荐指数
1
解决办法
2695
查看次数

使用junit 4.10进行单元测试

在这里使用JUnit 4.10是我的测试.

package geometry;

import org.junit.Assert.*;
import org.junit.Test;

public class SegmentTest extends junit.framework.TestCase {

    @Test
    public void SegmentParallelTest() {
        Segment a = new Segment(10, 5, 20, 11);
        Segment b = new Segment(20, 6, 30, 11);
        assertFalse(a.isParallel(b));
    }

    public static junit.framework.Test suite() {
        return new junit.framework.JUnit4TestAdapter(SegmentTest.class);
    }

    public static void main(String args[]) {
        org.junit.runner.JUnitCore.main("geometry.SegmentTest");
    }
}
Run Code Online (Sandbox Code Playgroud)

这会产生以下错误消息......

junit.framework.AssertionFailedError: No tests found in geometry.SegmentTest
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at …
Run Code Online (Sandbox Code Playgroud)

unit-testing junit4

0
推荐指数
1
解决办法
990
查看次数

标签 统计

c++ ×1

junit4 ×1

osx-snow-leopard ×1

unit-testing ×1

vim ×1