Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
profezzorn committed Aug 7, 2024
1 parent d2c2ba7 commit f986d46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 60 deletions.
4 changes: 2 additions & 2 deletions sound/sound_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SoundLibrary {
bool Play(SoundToPlay p) { return SOUNDQ->Play(p); }
void Poll(RefPtr<BufferedWavPlayer>& player) {}

void init() {
static void init() {
SOUNDQ->require_version(SoundLibraryVersion);
}

Expand Down Expand Up @@ -517,7 +517,7 @@ class SoundLibrary {
class SoundLibraryV2 : public SoundLibrary {
public:
static const int SoundLibraryVersion = 2;
void init() {
static void init() {
SOUNDQ->require_version(SoundLibraryVersion);
}

Expand Down
58 changes: 0 additions & 58 deletions sound/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,64 +373,6 @@ void test_playwav() {
CHECK_EQ(1023, readallsamples(&wav));
}

template<class SPEC>
class SoundLibraryTemplate {
public:
static const int SoundLibraryVersion = 1;
};

template<class SPEC>
class SoundLibraryV2Template : public SoundLibraryTemplate<SPEC> {
public:
static const int SoundLibraryVersion = 2;
};

template<class SPEC>
class SoundLibraryV3Template : public SoundLibraryV2Template<SPEC> {
public:
static const int SoundLibraryVersion = 3;
};

template<class SPEC>
class SoundLibraryV4Template : public SoundLibraryV3Template<SPEC> {
public:
static const int SoundLibraryVersion = 4;
};

template<class SPEC>
class SoundLibraryV5Template : public SoundLibraryV4Template<SPEC> {
public:
static const int SoundLibraryVersion = 5;
};

#include "../common/malloc_helper.h"

#define SOUND_SOUND_LIBRARY_H

#include "sound_library.h"
static_assert(MKSPEC<FINAL_MENU_SPEC_TEMPLATE>::SoundLibrary::SoundLibraryVersion == 1);

template<class SPEC>
struct FOOSPEC {
static const int fnord = 17;
typedef SoundLibraryTemplate<SPEC> SoundLibrary;
};
#define MENU_SPEC_TEMPLATE FOOSPEC
#define MIN_SOUND_LIBRARY_VERSION 2
#include "sound_library.h"
static_assert(MKSPEC<FINAL_MENU_SPEC_TEMPLATE>::SoundLibrary::SoundLibraryVersion == 2);
static_assert(MKSPEC<FINAL_MENU_SPEC_TEMPLATE>::fnord == 17);

#define MIN_SOUND_LIBRARY_VERSION 1
#include "sound_library.h"
static_assert(MKSPEC<FINAL_MENU_SPEC_TEMPLATE>::SoundLibrary::SoundLibraryVersion == 2);
static_assert(MKSPEC<FINAL_MENU_SPEC_TEMPLATE>::fnord == 17);

#define MIN_SOUND_LIBRARY_VERSION 3
#include "sound_library.h"
static_assert(MKSPEC<FINAL_MENU_SPEC_TEMPLATE>::SoundLibrary::SoundLibraryVersion == 3);
static_assert(MKSPEC<FINAL_MENU_SPEC_TEMPLATE>::fnord == 17);

int main() {
test_effects();
test_playwav();
Expand Down

0 comments on commit f986d46

Please sign in to comment.