int main() { int numPlayers = 2; int kingdomCards[10] = {smithy, adventurer, gardens, embargo, great_hall, mine, ambassador, outpost, baron, tribute}; int randomSeed = 15; struct gameState state; int result = 0; int oldHandCount, newHandCount; int oldActionCount, newActionCount; printf("CARDTEST3: GREAT HALL\n"); initializeGame(numPlayers, kingdomCards, randomSeed, &state); oldHandCount = numHandCards(&state); oldActionCount = state.numActions; //int cardEffect(int card, int choice1, int choice2, int choice3, struct gameState *state, int handPos, int *bonus); //TEST GREAT HALL result = cardEffect(great_hall, 0, 0, 0, &state, 1, NULL); assertc(result, "Completely failed Great Hall"); newHandCount = numHandCards(&state); assertSame(oldHandCount, newHandCount, "Hand sizes aren't the same"); newActionCount = state.numActions; assertDiff(oldActionCount, newActionCount, "Actions didn't change"); if (newActionCount == oldActionCount + 1) { result = 0; } assertc(result, "Actions didn't increment by 1"); checkFail(); return 0; }
TIMED_TEST(StringTests, diffOutputFailTest, TEST_TIMEOUT_DEFAULT) { std::cout << "hi\thow\tare\tyou?" << std::endl; std::string exp = "Hi\nyo\nbye\nhow are you\nok\nthe end"; std::string stu = std::string("Hi\nOOPS\nbye\nhow\t are") + '\0' + std::string(" you\\\nDOH\nthe end"); assertDiff("program output", exp, stu); }