Skip to content

Commit

Permalink
Add a unittest for playing audio
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Feb 13, 2024
1 parent 1d5fbbc commit 7380197
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/unittest/SoundTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2024 Jan Niklas Hasse <[email protected]>
// For conditions of distribution and use, see copyright notice in LICENSE.txt

#include "../jngl/sound.hpp"
#include "Fixture.hpp"

#include <jngl.hpp>

#include <boost/ut.hpp>

namespace {
boost::ut::suite _ = [] {
using namespace boost::ut; // NOLINT
"Sound"_test = [] {
Fixture f(1);
jngl::play("../data/test.ogg");
expect(jngl::isPlaying("../data/test.ogg"));
jngl::stop("../data/test.ogg");
expect(!jngl::isPlaying("../data/test.ogg"));
};
};
} // namespace

0 comments on commit 7380197

Please sign in to comment.