// Path: src/main/java/org/picofarad/sdr101/blocks/sources/ImpulseSource.java
// public class ImpulseSource implements SignalBlock {
//     private boolean first;
// 
//     public ImpulseSource() {
//         first = true;
//     }
// 
//     public double output() {
//         if (first) {
//             first = false;
//             return 1.0;
//         } else {
//             return 0.0;
//         }
//     }
// }


import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.picofarad.sdr101.blocks.sources.ImpulseSource;
        Assert.assertEquals(1.0, c.get(0), 0.0001);
        Assert.assertEquals(2.0, c.get(1), 0.0001);
        Assert.assertEquals(0.12345, c.get(2), 0.0001);
        Assert.assertEquals(-0.5, c.get(3), 0.0001);
        Assert.assertEquals(-1.0, c.get(4), 0.0001);
    }

    @Test
    public void testLoadFirFromFileBadData() {
        try {
            FilterFactory.loadFirFromFile("/firTestBadData.txt");
            Assert.fail("Did not throw exception.");
        } catch (IOException e) {
        }
    }

    @Test
    public void testLoadFirFromFileBadFilename() throws IOException {
        try {
            FilterFactory.loadFirFromFile("/thisFileDoesNotExist.txt");
            Assert.fail("Did not throw exception.");
        } catch (FileNotFoundException e) {
        }
    }

    @Test
    public void testLoadFirFromFile() throws IOException {
        FirFilter ff = FilterFactory.loadFirFromFile("/firTest.txt");
        Assert.assertNotNull(ff);

// Path: src/main/java/org/picofarad/sdr101/blocks/sources/ImpulseSource.java
// public class ImpulseSource implements SignalBlock {
//     private boolean first;
// 
//     public ImpulseSource() {
//         first = true;
//     }
// 
//     public double output() {
//         if (first) {
//             first = false;
//             return 1.0;
//         } else {
//             return 0.0;
//         }
//     }
// }


// Path: src/test/java/org/picofarad/sdr101/blocks/FilterFactoryTest.java
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.picofarad.sdr101.blocks.sources.ImpulseSource;

        Assert.assertEquals(1.0, c.get(0), 0.0001);
        Assert.assertEquals(2.0, c.get(1), 0.0001);
        Assert.assertEquals(0.12345, c.get(2), 0.0001);
        Assert.assertEquals(-0.5, c.get(3), 0.0001);
        Assert.assertEquals(-1.0, c.get(4), 0.0001);
    }

    @Test
    public void testLoadFirFromFileBadData() {
        try {
            FilterFactory.loadFirFromFile("/firTestBadData.txt");
            Assert.fail("Did not throw exception.");
        } catch (IOException e) {
        }
    }

    @Test
    public void testLoadFirFromFileBadFilename() throws IOException {
        try {
            FilterFactory.loadFirFromFile("/thisFileDoesNotExist.txt");
            Assert.fail("Did not throw exception.");
        } catch (FileNotFoundException e) {
        }
    }

    @Test
    public void testLoadFirFromFile() throws IOException {
        FirFilter ff = FilterFactory.loadFirFromFile("/firTest.txt");
        Assert.assertNotNull(ff);

        ff.setInput(new ImpulseSource());