示例#1
0
TEST (AudioDataTest, PrependToNew) {
  KeyFinder::AudioData a;
  KeyFinder::AudioData b;

  ASSERT_NO_THROW(a.prepend(b));
  ASSERT_EQ(0, a.getChannels());
  ASSERT_EQ(0, a.getFrameRate());

  b.setChannels(1);
  b.setFrameRate(1);
  b.addToFrameCount(1);

  ASSERT_NO_THROW(a.prepend(b));
  ASSERT_EQ(1, a.getChannels());
  ASSERT_EQ(1, a.getFrameRate());
  ASSERT_EQ(1, a.getFrameCount());
}
TEST (LowPassFilterTest, DoesntAlterAudioMetadata) {
    KeyFinder::AudioData a;
    a.setChannels(1);
    a.setFrameRate(frameRate);
    a.addToSampleCount(frameRate);

    KeyFinder::LowPassFilter* lpf = new KeyFinder::LowPassFilter(filterOrder, frameRate, cornerFrequency, filterFFT);
    KeyFinder::Workspace w;
    lpf->filter(a, w);
    delete lpf;

    ASSERT_EQ(1, a.getChannels());
    ASSERT_EQ(frameRate, a.getFrameRate());
    ASSERT_EQ(frameRate, a.getSampleCount());
}
示例#3
0
TEST (AudioDataTest, Channels) {
  KeyFinder::AudioData a;
  a.setChannels(2);
  ASSERT_EQ(2, a.getChannels());
  ASSERT_THROW(a.setChannels(0), KeyFinder::Exception);
}
示例#4
0
TEST (AudioDataTest, ConstructorWorks) {
  KeyFinder::AudioData a;
  ASSERT_EQ(0, a.getChannels());
  ASSERT_EQ(0, a.getFrameRate());
  ASSERT_EQ(0, a.getSampleCount());
}