From 6a9dbe016eb09ab087efca15ab7d1d0ca02c3830 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Sat, 25 May 2024 12:57:42 +0200 Subject: [PATCH] Revert "fix genres conflict" This reverts commit bac4da6b0496d6d81948720f43c1ae9552d2622a. --- src/modules/book/Book.cpp | 2 +- src/modules/book/BookData.cpp | 50 +++++++++++++++---------------- src/modules/book/BookData.h | 2 +- src/modules/movie/Movie.cpp | 2 +- src/modules/movie/MovieData.cpp | 4 +-- src/modules/movie/MovieData.h | 2 +- src/modules/music/Music.cpp | 2 +- src/modules/music/data/Genres.h | 2 +- tests/modules/book/BookTest.cpp | 2 +- tests/modules/movie/MovieTest.cpp | 2 +- tests/modules/music/MusicTest.cpp | 2 +- 11 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/modules/book/Book.cpp b/src/modules/book/Book.cpp index d9a22abeb..934a7d62c 100644 --- a/src/modules/book/Book.cpp +++ b/src/modules/book/Book.cpp @@ -15,7 +15,7 @@ std::string_view Book::title() std::string_view Book::genre() { - return Helper::arrayElement(bookGenres); + return Helper::arrayElement(genres); } std::string_view Book::author() diff --git a/src/modules/book/BookData.cpp b/src/modules/book/BookData.cpp index 7137cd775..593016aea 100644 --- a/src/modules/book/BookData.cpp +++ b/src/modules/book/BookData.cpp @@ -109,31 +109,31 @@ const std::array bookFormats{ "Kindle", }; -const std::array bookGenres = {"Adventure stories", - "Classics", - "Crime", - "Fairy tales, fables, and folk tales", - "Fantasy", - "Historical fiction", - "Horror", - "Humour and satire", - "Literary fiction", - "Mystery", - "Poetry", - "Plays", - "Romance", - "Science fiction", - "Short stories", - "Thrillers", - "War", - "Women’s fiction", - "Young adult", - "Non-fiction", - "Autobiography and memoir", - "Biography", - "Essays", - "Non-fiction novel", - "Self-help"}; +const std::array genres = {"Adventure stories", + "Classics", + "Crime", + "Fairy tales, fables, and folk tales", + "Fantasy", + "Historical fiction", + "Horror", + "Humour and satire", + "Literary fiction", + "Mystery", + "Poetry", + "Plays", + "Romance", + "Science fiction", + "Short stories", + "Thrillers", + "War", + "Women’s fiction", + "Young adult", + "Non-fiction", + "Autobiography and memoir", + "Biography", + "Essays", + "Non-fiction novel", + "Self-help"}; const std::array publishers = {"Academic Press", "Ace Books", diff --git a/src/modules/book/BookData.h b/src/modules/book/BookData.h index 4982ee268..ab5304970 100644 --- a/src/modules/book/BookData.h +++ b/src/modules/book/BookData.h @@ -7,7 +7,7 @@ namespace faker { extern const std::array authors; extern const std::array bookFormats; -extern const std::array bookGenres; +extern const std::array genres; extern const std::array publishers; extern const std::array bookSeries; extern const std::array titles; diff --git a/src/modules/movie/Movie.cpp b/src/modules/movie/Movie.cpp index a4d72b128..9b9d0ce16 100644 --- a/src/modules/movie/Movie.cpp +++ b/src/modules/movie/Movie.cpp @@ -7,7 +7,7 @@ namespace faker { std::string_view Movie::genre() { - return Helper::arrayElement(movieGenres); + return Helper::arrayElement(genres); } std::string_view Movie::movieTitle() diff --git a/src/modules/movie/MovieData.cpp b/src/modules/movie/MovieData.cpp index f9e59c3cb..beaa3f0ce 100644 --- a/src/modules/movie/MovieData.cpp +++ b/src/modules/movie/MovieData.cpp @@ -910,7 +910,7 @@ const std::array directors = { "Éric Rohmer" }; -const std::array movieGenres = { +const std::array genres = { "Action", "Comedy", "Drama", @@ -1300,4 +1300,4 @@ const std::array tvShows = { "When They See Us" }; -} +} \ No newline at end of file diff --git a/src/modules/movie/MovieData.h b/src/modules/movie/MovieData.h index 954649140..ce7ddf0ab 100644 --- a/src/modules/movie/MovieData.h +++ b/src/modules/movie/MovieData.h @@ -10,7 +10,7 @@ namespace faker extern const std::array actors; extern const std::array actresses; extern const std::array directors; -extern const std::array movieGenres; +extern const std::array genres; extern const std::array movies; extern const std::array tvShows; } diff --git a/src/modules/music/Music.cpp b/src/modules/music/Music.cpp index 015bed976..2fbda9983 100644 --- a/src/modules/music/Music.cpp +++ b/src/modules/music/Music.cpp @@ -14,7 +14,7 @@ std::string Music::artist() std::string Music::genre() { - return Helper::arrayElement(musicGenres); + return Helper::arrayElement(genres); } std::string Music::songName() diff --git a/src/modules/music/data/Genres.h b/src/modules/music/data/Genres.h index 2fb5ce0ca..fe5ea2188 100644 --- a/src/modules/music/data/Genres.h +++ b/src/modules/music/data/Genres.h @@ -5,7 +5,7 @@ namespace faker { -const std::vector musicGenres = { +const std::vector genres = { "Rock", "Metal", "Pop", "Electronic", "Folk", "World", "Country", "Jazz", "Funk", "Soul", "Hip Hop", "Classical", "Latin", "Reggae", "Stage And Screen", "Blues", "Rap", }; diff --git a/tests/modules/book/BookTest.cpp b/tests/modules/book/BookTest.cpp index 8e36092bd..1bfe76649 100644 --- a/tests/modules/book/BookTest.cpp +++ b/tests/modules/book/BookTest.cpp @@ -26,7 +26,7 @@ TEST_F(BookTest, shouldGenerateGenre) { const auto bookGenre = Book::genre(); - ASSERT_TRUE(std::ranges::any_of(bookGenres, [bookGenre](const std::string_view& genre) { return genre == bookGenre; })); + ASSERT_TRUE(std::ranges::any_of(genres, [bookGenre](const std::string_view& genre) { return genre == bookGenre; })); } TEST_F(BookTest, shouldGenerateAuthor) diff --git a/tests/modules/movie/MovieTest.cpp b/tests/modules/movie/MovieTest.cpp index 060cd7fc4..ea02dcc50 100644 --- a/tests/modules/movie/MovieTest.cpp +++ b/tests/modules/movie/MovieTest.cpp @@ -19,7 +19,7 @@ TEST_F(MovieTest, shouldGenerateGenre) const auto generatedGenre = Movie::genre(); ASSERT_TRUE( - std::ranges::any_of(movieGenres, [generatedGenre](const std::string_view& genre) { return generatedGenre == genre; })); + std::ranges::any_of(genres, [generatedGenre](const std::string_view& genre) { return generatedGenre == genre; })); } TEST_F(MovieTest, shouldGenerateMovieTitle) diff --git a/tests/modules/music/MusicTest.cpp b/tests/modules/music/MusicTest.cpp index 82740bc6b..5002d39b7 100644 --- a/tests/modules/music/MusicTest.cpp +++ b/tests/modules/music/MusicTest.cpp @@ -29,7 +29,7 @@ TEST_F(MusicTest, shouldGenerateGenre) const auto generatedGenre = Music::genre(); ASSERT_TRUE( - std::ranges::any_of(musicGenres, [generatedGenre](const std::string& genre) { return generatedGenre == genre; })); + std::ranges::any_of(genres, [generatedGenre](const std::string& genre) { return generatedGenre == genre; })); } TEST_F(MusicTest, shouldGenerateSongName)