Fix C++ code smells

* Move "using namespace std;" from header to module file (to no longer pollute the global namespace).
* Fix inconsistency of having namespace prefix in test code.
* Add include guard to GildedRose.h.
* Avoid std::endl.
* Have consistent white-space.
This commit is contained in:
tbeu committed 2025-02-12 20:56:22 +01:00
1 parent 6c59257f27
commit 73a51ef14f
7 files changed
+22 -23

No files matched your search

@@ -12,12 +12,12 @@ std::ostream& operator<<(std::ostream& os, const Item& obj)
TEST(GildedRoseApprovalTests, VerifyCombinations) {
std::vector<string> names { "Foo" };
std::vector<std::string> names { "Foo" };
std::vector<int> sellIns { 1 };
std::vector<int> qualities { 1 };
auto f = [](string name, int sellIn, int quality) {
vector<Item> items = {Item(name, sellIn, quality)};
auto f = [](std::string name, int sellIn, int quality) {
std::vector<Item> items = {Item(name, sellIn, quality)};
GildedRose app(items);
app.updateQuality();
return items[0];