diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2021-01-03 18:36:23 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2021-01-03 18:36:23 +0100 |
commit | b1b86807e1e8044855e90f87a7804e1d805aaed1 (patch) | |
tree | 4410b177df331b8fc873825418856ca538998096 /src | |
parent | cd527f327dfff2934d6f50476cd34c985563d69f (diff) |
SeratoTagsTest: Add test for lossless hotcue color roundtripping
Diffstat (limited to 'src')
-rw-r--r-- | src/test/seratotagstest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/seratotagstest.cpp b/src/test/seratotagstest.cpp index 450adf1fd8..4b7963e3a3 100644 --- a/src/test/seratotagstest.cpp +++ b/src/test/seratotagstest.cpp @@ -1,6 +1,7 @@ #include <gtest/gtest.h> #include "track/serato/tags.h" +#include "util/color/predefinedcolorpalettes.h" class SeratoTagsTest : public testing::Test { protected: @@ -161,3 +162,22 @@ TEST_F(SeratoTagsTest, SetCueInfos) { EXPECT_EQ(seratoTags.getCueInfos().size(), cueInfos.size()); EXPECT_EQ(seratoTags.getCueInfos(), cueInfos); } + +TEST_F(SeratoTagsTest, CueColorConversionRoundtrip) { + for (const auto color : mixxx::PredefinedColorPalettes:: + kSeratoTrackMetadataHotcueColorPalette) { + const auto displayedColor = mixxx::SeratoTags::storedToDisplayedSeratoDJProCueColor(color); + const auto storedColor = + mixxx::SeratoTags::displayedToStoredSeratoDJProCueColor( + displayedColor); + EXPECT_EQ(color, storedColor); + } + + for (const auto color : mixxx::PredefinedColorPalettes::kSeratoDJProHotcueColorPalette) { + const auto storedColor = mixxx::SeratoTags::displayedToStoredSeratoDJProCueColor(color); + const auto displayedColor = + mixxx::SeratoTags::storedToDisplayedSeratoDJProCueColor( + storedColor); + EXPECT_EQ(color, displayedColor); + } +} |