From 76667ef0fa911fc8bf37df72896645dbfbbc0763 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Feb 2017 20:03:51 +0300 Subject: Add sdl mixer version into libs version dump. --- src/utils/dumplibs.cpp | 6 ++++++ src/utils/dumplibs_unittest.cc | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'src/utils') diff --git a/src/utils/dumplibs.cpp b/src/utils/dumplibs.cpp index 8fb7036bf..34b63e71a 100644 --- a/src/utils/dumplibs.cpp +++ b/src/utils/dumplibs.cpp @@ -26,6 +26,7 @@ #include #include +#include PRAGMACLANG6(GCC diagnostic push) PRAGMACLANG6(GCC diagnostic ignored "-Wold-style-cast") #include @@ -127,6 +128,7 @@ void dumpLibs() dumpCompiledSdlVersion("SDL", SDL); dumpCompiledSdlVersion("SDL_net", SDL_NET); dumpCompiledSdlVersion("SDL_image", SDL_IMAGE); + dumpCompiledSdlVersion("SDL_mixer", SDL_MIXER); dumpCompiledSdlVersion("SDL_ttf", SDL_TTF); logger->log("Linked with:"); @@ -154,6 +156,7 @@ void dumpLibs() #endif // USE_SDL2 dumpLinkedSdlVersion("SDL_net", SDLNet_Linked_Version()); dumpLinkedSdlVersion("SDL_image", IMG_Linked_Version()); + dumpLinkedSdlVersion("SDL_mixer", Mix_Linked_Version()); dumpLinkedSdlVersion("SDL_ttf", TTF_Linked_Version()); compareVersions("zLib", ZLIB_VERSION, zlibVersion()); @@ -170,6 +173,9 @@ void dumpLibs() compareSDLVersions("SDL_image", sdlVersionJoin(SDL_IMAGE), IMG_Linked_Version()); + compareSDLVersions("SDL_mixer", + sdlVersionJoin(SDL_MIXER), + Mix_Linked_Version()); compareSDLVersions("SDL_ttf", sdlVersionJoin(SDL_TTF), TTF_Linked_Version()); diff --git a/src/utils/dumplibs_unittest.cc b/src/utils/dumplibs_unittest.cc index d89dee5fd..aca0f91f3 100644 --- a/src/utils/dumplibs_unittest.cc +++ b/src/utils/dumplibs_unittest.cc @@ -25,6 +25,7 @@ #include "utils/stringutils.h" #include +#include PRAGMACLANG6(GCC diagnostic push) PRAGMACLANG6(GCC diagnostic ignored "-Wold-style-cast") #include @@ -123,6 +124,22 @@ TEST_CASE("dumplibs tests") REQUIRE(build == link); } + SECTION("sdl_mixer") + { + const SDL_version *const linkVersion = Mix_Linked_Version(); + + const std::string build = strprintf("%d.%d.%d", + SDL_MIXER_MAJOR_VERSION, + SDL_MIXER_MINOR_VERSION, + SDL_MIXER_PATCHLEVEL); + const std::string link = strprintf("%d.%d.%d", + linkVersion->major, + linkVersion->minor, + linkVersion->patch); + + REQUIRE(build == link); + } + SECTION("sdl_ttf") { const SDL_version *const linkVersion = TTF_Linked_Version(); -- cgit v1.2.3-70-g09d2