From bff2e7d64d45d8e331da703cba0d74894cf32a84 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 8 Jan 2025 14:47:31 +0100 Subject: fix audio unit test --- src/test/AudioTest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/test/AudioTest.cpp b/src/test/AudioTest.cpp index 3844c73..e548221 100644 --- a/src/test/AudioTest.cpp +++ b/src/test/AudioTest.cpp @@ -60,6 +60,8 @@ TEST_F(AudioTest, Play) { InSequence seq; EXPECT_CALL(context, play(_)).Times(0); + EXPECT_CALL(context, set_loop(_, _)).Times(0); + EXPECT_CALL(context, set_volume(_, _)).Times(0); component.play(); } @@ -67,6 +69,8 @@ TEST_F(AudioTest, Play) { InSequence seq; EXPECT_CALL(context, play(_)).Times(1); + EXPECT_CALL(context, set_loop(_, _)).Times(1); + EXPECT_CALL(context, set_volume(_, _)).Times(1); system.fixed_update(); } } @@ -146,6 +150,9 @@ TEST_F(AudioTest, PlayOnActive) { InSequence seq; EXPECT_CALL(context, play(_)).Times(1); + EXPECT_CALL(context, set_loop(_, _)).Times(1); + EXPECT_CALL(context, set_volume(_, _)).Times(1); + component.active = true; system.fixed_update(); } @@ -156,6 +163,8 @@ TEST_F(AudioTest, PlayImmediately) { component.play(); EXPECT_CALL(context, play(_)).Times(1); + EXPECT_CALL(context, set_volume(_, _)).Times(1); + EXPECT_CALL(context, set_loop(_, _)).Times(1); system.fixed_update(); } -- cgit v1.2.3 From b92b3b830dc53ecc2accf8472a8e4ce8be2e19dc Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 8 Jan 2025 14:49:09 +0100 Subject: `make format` --- game/Random.cpp | 1 - game/Random.h | 2 -- src/crepe/api/Sprite.cpp | 4 +--- 3 files changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/game/Random.cpp b/game/Random.cpp index 59be3c5..ace6245 100644 --- a/game/Random.cpp +++ b/game/Random.cpp @@ -25,4 +25,3 @@ unsigned Random::u(unsigned upper, unsigned lower) { unsigned x = rand() % range; return x + lower; } - diff --git a/game/Random.h b/game/Random.h index cf05e87..8af9669 100644 --- a/game/Random.h +++ b/game/Random.h @@ -6,6 +6,4 @@ public: static double d(double upper = 1.0, double lower = 0.0); static int i(int upper, int lower = 0); static unsigned u(unsigned upper, unsigned lower = 0); - }; - diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp index 2919857..3c77e2e 100644 --- a/src/crepe/api/Sprite.cpp +++ b/src/crepe/api/Sprite.cpp @@ -20,9 +20,7 @@ Sprite::Sprite(game_object_id_t id, const Asset & texture, const Sprite::Data & Sprite::~Sprite() { dbg_trace(); } -unique_ptr Sprite::save() const { - return unique_ptr(new Sprite(*this)); -} +unique_ptr Sprite::save() const { return unique_ptr(new Sprite(*this)); } void Sprite::restore(const Component & snapshot) { *this = static_cast(snapshot); -- cgit v1.2.3