Skip to content

Instantly share code, notes, and snippets.

@datguy
Last active August 29, 2015 14:13
Show Gist options
  • Save datguy/a2353668b77a53e1ea82 to your computer and use it in GitHub Desktop.
Save datguy/a2353668b77a53e1ea82 to your computer and use it in GitHub Desktop.
PAppletTest
package processing.core;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class PAppletTest {
@Before
public void setUp() throws Exception {
}
@Test
public void minIntTest() {
assertTrue(1==PApplet.min(1,2));
assertTrue(1==PApplet.min(3,2,1));
assertTrue(1==PApplet.min(3,2,1,5));
assertTrue(1==PApplet.min(3,2,1,5,9,7,8,6,4));
}
@Test
public void maxIntTest() {
assertTrue(2==PApplet.max(1,2));
assertTrue(3==PApplet.max(3,2,1));
assertTrue(5==PApplet.max(3,2,1,5));
assertTrue(9==PApplet.max(3,2,1,5,9,7,8,6,4));
}
@Test
public void minFloatTest() {
assertTrue(1.0==PApplet.min(1.0f,2.0f));
assertTrue(1.0==PApplet.min(3.0f,2.0f,1.0f));
assertTrue(1.0==PApplet.min(3.0f,2.0f,1.0f,5.0f));
assertTrue(1.0==PApplet.min(3.0f,2.0f,1.0f,5.0f,9.0f,7.0f,8.0f,6.0f,4.0f));
}
@Test
public void maxFloatTest() {
assertTrue(2.0==PApplet.max(1.0f,2.0f));
assertTrue(3.0==PApplet.max(3.0f,2.0f,1.0f));
assertTrue(5.0==PApplet.max(3.0f,2.0f,1.0f,5.0f));
assertTrue(9.0==PApplet.max(3.0f,2.0f,1.0f,5.0f,9.0f,7.0f,8.0f,6.0f,4.0f));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment