Skip to content

Commit

Permalink
fix genres conflict (cieslarmichal#587)
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries authored and 00thirdeye00 committed Jun 20, 2024
1 parent 31cc4cb commit e16a66d
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/modules/book/Book.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ std::string_view Book::title()

std::string_view Book::genre()
{
return Helper::arrayElement(genres);
return Helper::arrayElement(bookGenres);
}

std::string_view Book::author()
Expand Down
50 changes: 25 additions & 25 deletions src/modules/book/BookData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,31 +109,31 @@ const std::array<std::string_view, 3> bookFormats{
"Kindle",
};

const std::array<std::string_view, 25> 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<std::string_view, 25> 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<std::string_view, 263> publishers = {"Academic Press",
"Ace Books",
Expand Down
2 changes: 1 addition & 1 deletion src/modules/book/BookData.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace faker
{
extern const std::array<std::string_view, 100> authors;
extern const std::array<std::string_view, 3> bookFormats;
extern const std::array<std::string_view, 25> genres;
extern const std::array<std::string_view, 25> bookGenres;
extern const std::array<std::string_view, 263> publishers;
extern const std::array<std::string_view, 19> bookSeries;
extern const std::array<std::string_view, 100> titles;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/movie/Movie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace faker
{
std::string_view Movie::genre()
{
return Helper::arrayElement(genres);
return Helper::arrayElement(movieGenres);
}

std::string_view Movie::movieTitle()
Expand Down
4 changes: 2 additions & 2 deletions src/modules/movie/MovieData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ const std::array<std::string_view, 300> directors = {
"Éric Rohmer"
};

const std::array<std::string_view, 9> genres = {
const std::array<std::string_view, 9> movieGenres = {
"Action",
"Comedy",
"Drama",
Expand Down Expand Up @@ -1300,4 +1300,4 @@ const std::array<std::string_view, 122> tvShows = {
"When They See Us"
};

}
}
2 changes: 1 addition & 1 deletion src/modules/movie/MovieData.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace faker
extern const std::array<std::string_view, 299> actors;
extern const std::array<std::string_view, 300> actresses;
extern const std::array<std::string_view, 300> directors;
extern const std::array<std::string_view, 9> genres;
extern const std::array<std::string_view, 9> movieGenres;
extern const std::array<std::string_view, 250> movies;
extern const std::array<std::string_view, 122> tvShows;
}
2 changes: 1 addition & 1 deletion src/modules/music/Music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ std::string Music::artist()

std::string Music::genre()
{
return Helper::arrayElement<std::string>(genres);
return Helper::arrayElement<std::string>(musicGenres);
}

std::string Music::songName()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/music/data/Genres.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace faker
{
const std::vector<std::string> genres = {
const std::vector<std::string> musicGenres = {
"Rock", "Metal", "Pop", "Electronic", "Folk", "World", "Country", "Jazz", "Funk", "Soul", "Hip Hop",
"Classical", "Latin", "Reggae", "Stage And Screen", "Blues", "Rap",
};
Expand Down
2 changes: 1 addition & 1 deletion src/modules/videoGame/VideoGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ std::string VideoGame::gameTitle()

std::string VideoGame::genre()
{
return Helper::arrayElement<std::string>(genres);
return Helper::arrayElement<std::string>(videoGameGenres);
}

std::string VideoGame::platform()
Expand Down
3 changes: 2 additions & 1 deletion src/modules/videoGame/data/Genres.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

namespace faker
{
const std::vector<std::string> genres = {"Action",
const std::vector<std::string> videoGameGenres = {
"Action",
"Adventure",
"Battle royale",
"Dating sim",
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/book/BookTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ TEST_F(BookTest, shouldGenerateGenre)
{
const auto bookGenre = Book::genre();

ASSERT_TRUE(std::ranges::any_of(genres, [bookGenre](const std::string_view& genre) { return genre == bookGenre; }));
ASSERT_TRUE(std::ranges::any_of(bookGenres, [bookGenre](const std::string_view& genre) { return genre == bookGenre; }));
}

TEST_F(BookTest, shouldGenerateAuthor)
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/movie/MovieTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TEST_F(MovieTest, shouldGenerateGenre)
const auto generatedGenre = Movie::genre();

ASSERT_TRUE(
std::ranges::any_of(genres, [generatedGenre](const std::string_view& genre) { return generatedGenre == genre; }));
std::ranges::any_of(movieGenres, [generatedGenre](const std::string_view& genre) { return generatedGenre == genre; }));
}

TEST_F(MovieTest, shouldGenerateMovieTitle)
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/music/MusicTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ TEST_F(MusicTest, shouldGenerateGenre)
const auto generatedGenre = Music::genre();

ASSERT_TRUE(
std::ranges::any_of(genres, [generatedGenre](const std::string& genre) { return generatedGenre == genre; }));
std::ranges::any_of(musicGenres, [generatedGenre](const std::string& genre) { return generatedGenre == genre; }));
}

TEST_F(MusicTest, shouldGenerateSongName)
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/videoGame/VideoGameTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST_F(VideoGameTest, shouldGenerateGenre)
const auto generatedGenre = VideoGame::genre();

ASSERT_TRUE(
std::ranges::any_of(genres, [generatedGenre](const std::string& genre) { return generatedGenre == genre; }));
std::ranges::any_of(videoGameGenres, [generatedGenre](const std::string& genre) { return generatedGenre == genre; }));
}

TEST_F(VideoGameTest, shouldGeneratePlatform)
Expand Down

0 comments on commit e16a66d

Please sign in to comment.