Files
NazaraEngine/tests/Engine/Audio/SoundBuffer.cpp
Jérôme Leclercq ed46c87781 Refactor the way resources are loaded (#191)
* WIP

* WIP

* Font works

* WIP: Only Music remains

* Looks like it's working

* Fix oopsie

* Core/ObjectRef: Add cast functions

* Update ChangeLog.md

* Audio/SoundStream: Make sound stream thread-safe
2018-10-28 01:53:11 +02:00

21 lines
499 B
C++

#include <Nazara/Audio/SoundBuffer.hpp>
#include <Catch/catch.hpp>
SCENARIO("SoundBuffer", "[AUDIO][SOUNDBUFFER]")
{
GIVEN("A sound buffer")
{
WHEN("We load our sound")
{
Nz::SoundBufferRef soundBuffer = Nz::SoundBuffer::LoadFromFile("resources/Engine/Audio/Cat.flac");
REQUIRE(soundBuffer.IsValid());
THEN("We can ask the informations of the file")
{
REQUIRE(soundBuffer->GetDuration() <= 8500); // 8s = 8000ms
REQUIRE(soundBuffer->GetDuration() >= 8000);
}
}
}
}