Include test vectors as a local resource

This eliminates an implicit test dependency on network connectivity
This commit is contained in:
Jon Chambers 2021-07-21 10:17:29 -04:00
parent 84a405197c
commit ed523d3db3
2 changed files with 19685 additions and 6 deletions

View File

@ -1,19 +1,14 @@
package com.southernstorm.noise.tests;
import java.io.InputStream;
import java.net.URL;
import org.junit.Assert;
import org.junit.Test;
public class UnitVectorTests {
private static final String testVectorsCommit = "5d0a74760320e5486ced302e36ccad91606aac43";
@Test
public void testBasicVector() throws Exception {
try (InputStream stream = new URL(
"https://raw.githubusercontent.com/rweather/noise-c/" + testVectorsCommit
+ "/tests/vector/noise-c-basic.txt").openStream()) {
try (final InputStream stream = getClass().getResourceAsStream("test-vectors.json")) {
VectorTests vectorTests = new VectorTests();
vectorTests.processInputStream(stream);
Assert.assertEquals(vectorTests.getFailed(), 0);

File diff suppressed because it is too large Load Diff