Skip to content

Commit

Permalink
Revert "fix genres conflict"
Browse files Browse the repository at this point in the history
This reverts commit bac4da6.
  • Loading branch information
uilianries committed May 25, 2024
1 parent e644ea1 commit 6a9dbe0
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 36 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(bookGenres);
return Helper::arrayElement(genres);
}

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> 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, 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, 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> bookGenres;
extern const std::array<std::string_view, 25> genres;
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(movieGenres);
return Helper::arrayElement(genres);
}

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> movieGenres = {
const std::array<std::string_view, 9> genres = {
"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> movieGenres;
extern const std::array<std::string_view, 9> genres;
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>(musicGenres);
return Helper::arrayElement<std::string>(genres);
}

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> musicGenres = {
const std::vector<std::string> genres = {
"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 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(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)
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(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)
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(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)
Expand Down

0 comments on commit 6a9dbe0

Please sign in to comment.