// Tests the save/load functions TEST(HighPassFilter, TestSaveLoad) { HighPassFilter hpf; //Check the id's matches EXPECT_TRUE( hpf.getId() == HighPassFilter::getId() ); const Float delta = 1.0 / 500.0f; //Set a delta for 500Hz //Set the gain with a valid value EXPECT_TRUE( hpf.setCutoffFrequency( 10, delta ) ); EXPECT_EQ( hpf.getFilterFactor(), GET_FILTER_FACTOR( 10.0, delta ) ); EXPECT_TRUE( hpf.save("hpf_unit_test_model.grt") ); EXPECT_TRUE( hpf.clear() ); EXPECT_TRUE( hpf.load("hpf_unit_test_model.grt") ); EXPECT_EQ( ROUND( hpf.getFilterFactor() ), ROUND( GET_FILTER_FACTOR( 10.0, delta ) ) ); //Due to differences in how things are load from the file, we need to round the expected value }