Adjust sound unit tests
This commit is contained in:
@@ -18,15 +18,21 @@ SCENARIO("Music", "[AUDIO][MUSIC]")
|
||||
|
||||
THEN("We can ask the informations of the file")
|
||||
{
|
||||
CHECK(music.GetDuration() <= 64000); // 1 min 03 = 63s = 63000ms
|
||||
CHECK(music.GetDuration() >= 63000);
|
||||
CHECK(music.GetDuration() == 63059); // 1 min 03 = 63s = 63000ms
|
||||
CHECK(music.GetFormat() == Nz::AudioFormat::I16_Stereo);
|
||||
CHECK(music.GetPlayingOffset() == 0);
|
||||
CHECK(music.GetSampleCount() <= 5644800); // 64s * 44100 Hz * 2 (stereo)
|
||||
CHECK(music.GetSampleCount() >= 5556600); // 63s * 44100 Hz * 2 (stereo)
|
||||
CHECK(music.GetSampleCount() <= 64 * 44100 * 2); // * 2 (stereo)
|
||||
CHECK(music.GetSampleCount() >= 63 * 44100 * 2); // * 2 (stereo)
|
||||
CHECK(music.GetSampleRate() == 44100 /* Hz */);
|
||||
CHECK(music.GetStatus() == Nz::SoundStatus::Stopped);
|
||||
CHECK(music.IsLooping() == false);
|
||||
CHECK_FALSE(music.IsLooping());
|
||||
CHECK(music.IsSpatializationEnabled());
|
||||
CHECK(music.GetMinDistance() == 1.f);
|
||||
CHECK(music.GetPitch() == 1.f);
|
||||
CHECK(music.GetPlayingOffset() == 0);
|
||||
CHECK(music.GetPosition() == Nz::Vector3f::Zero());
|
||||
CHECK(music.GetVelocity() == Nz::Vector3f::Zero());
|
||||
CHECK(music.GetVolume() == 1.f);
|
||||
}
|
||||
|
||||
THEN("We can play it and get the time offset")
|
||||
@@ -38,7 +44,7 @@ SCENARIO("Music", "[AUDIO][MUSIC]")
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
CHECK(music.GetPlayingOffset() >= 950);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
CHECK(music.GetPlayingOffset() <= 1300);
|
||||
CHECK(music.GetPlayingOffset() <= 1500);
|
||||
|
||||
music.SetPlayingOffset(4200);
|
||||
CHECK(music.GetStatus() == Nz::SoundStatus::Playing);
|
||||
|
||||
Reference in New Issue
Block a user