Moved gtest to a new file

This commit is contained in:
Jonas Granquist 2012-02-25 08:59:26 +01:00
parent e8cfd96ccf
commit b6553ce2f1
3 changed files with 14 additions and 12 deletions

View File

@ -1,5 +1,3 @@
#include <gtest/gtest.h>
#include <string>
using namespace std;
@ -113,11 +111,3 @@ void example()
}
TEST(GildedRoseTest, Foo) {
vector<Item> items;
items.push_back(Item("Foo", 0, 0));
GildedRose app(items);
app.updateQuality();
EXPECT_EQ("fixme", app.items[0].name);
}

View File

@ -0,0 +1,12 @@
#include <gtest/gtest.h>
#include "GildedRose.h"
TEST(GildedRoseTest, Foo) {
vector<Item> items;
items.push_back(Item("Foo", 0, 0));
GildedRose app(items);
app.updateQuality();
EXPECT_EQ("fixme", app.items[0].name);
}

View File

@ -71,5 +71,5 @@ gtest_main.a : gtest-all.o gtest_main.o
# $(GTEST_HEADERS)
# $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/GildedRose.h
GildedRose : GildedRose.h gtest_main.a
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(USER_DIR)/GildedRose.h -pthread $^ -o $@
GildedRose : GildedRoseUnitTests.cc gtest_main.a
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -pthread $^ -o $@