From bb3a7900dfb252298de1a8d67d3d1112524b3dad Mon Sep 17 00:00:00 2001 From: Grigory Ustinov Date: Fri, 9 Feb 2018 18:05:34 +0300 Subject: [PATCH 1/2] Fix 2 stack tests --- tests/stack_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/stack_test.c b/tests/stack_test.c index e23a042..9776af3 100644 --- a/tests/stack_test.c +++ b/tests/stack_test.c @@ -217,7 +217,7 @@ void test_stack_reverse_on_stack_empty_stack() { old_stack = stack; stack_reversed_stack = stack_reverse(stack); - assert(stack_reversed_stack == old_stack); + assert(stacks_equal(stack_reversed_stack, old_stack)); stack_free(stack); } @@ -236,7 +236,7 @@ void test_stack_reverse_on_stack_with_one_element() { old_stack = stack; stack_reversed_stack = stack_reverse(stack); - assert(stack_reversed_stack == old_stack); + assert(stacks_equal(stack_reversed_stack, old_stack)); stack_free(stack); } From ccaac9b3ac4257d382026f56609d183f3218c6e6 Mon Sep 17 00:00:00 2001 From: Grigory Ustinov Date: Mon, 12 Feb 2018 15:39:26 +0300 Subject: [PATCH 2/2] Add todos for fixing errors in game tests --- tests/game_test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/game_test.c b/tests/game_test.c index ed6833f..9b30d14 100644 --- a/tests/game_test.c +++ b/tests/game_test.c @@ -129,6 +129,7 @@ void test_valid_move_from_waste_pile_to_foundation_stacks() { card_set(foundation_stacks[2]->card, ACE, SPADES, EXPOSED, FOUNDATION_BEGIN_Y, FOUNDATION_2_BEGIN_X); card_set(foundation_stacks[3]->card, ACE, SPADES, EXPOSED, FOUNDATION_BEGIN_Y, FOUNDATION_3_BEGIN_X); for (int i = 0; i < 4; i++) { + // TODO: fix error here assert(valid_move(waste_pile, foundation_stacks[i])); } stack_free(waste_pile); @@ -155,6 +156,7 @@ void test_valid_move_from_waste_pile_to_maneuvre_stacks() { card_set(maneuvre_stacks[5]->card, ACE, SPADES, EXPOSED, MANEUVRE_BEGIN_Y, MANEUVRE_5_BEGIN_X); card_set(maneuvre_stacks[6]->card, ACE, SPADES, EXPOSED, MANEUVRE_BEGIN_Y, MANEUVRE_6_BEGIN_X); for (int i = 0; i < 7; i++) { + // TODO: fix error here assert(valid_move(waste_pile, maneuvre_stacks[i])); } stack_free(waste_pile); @@ -225,6 +227,7 @@ void test_valid_move_from_foundation_stack_to_foundation_stacks() { if (i == j) { assert(!valid_move(foundation_stacks[i], foundation_stacks[j])); } else { + // TODO: fix error here assert(valid_move(foundation_stacks[i], foundation_stacks[j])); } } @@ -259,6 +262,7 @@ void test_valid_move_from_foundation_stack_to_maneuvre_stacks() { card_set(maneuvre_stacks[6]->card, ACE, SPADES, EXPOSED, MANEUVRE_BEGIN_Y, MANEUVRE_6_BEGIN_X); for (int i = 0; i < 4; i++) { for (int j = 0; j < 7; j++) { + // TODO: fix error here assert(valid_move(foundation_stacks[i], maneuvre_stacks[j])); } } @@ -347,6 +351,7 @@ void test_valid_move_from_maneuvre_stack_to_foundation_stacks() { card_set(maneuvre_stacks[6]->card, ACE, SPADES, EXPOSED, MANEUVRE_BEGIN_Y, MANEUVRE_6_BEGIN_X); for (int i = 0; i < 7; i++) { for (int j = 0; j < 4; j++) { + // TODO: fix error here assert(valid_move(maneuvre_stacks[i], foundation_stacks[j])); } } @@ -377,6 +382,7 @@ void test_valid_move_from_maneuvre_stack_to_maneuvre_stacks() { if (i == j) { assert(!valid_move(maneuvre_stacks[i], maneuvre_stacks[j])); } else { + // TODO: fix error here assert(valid_move(maneuvre_stacks[i], maneuvre_stacks[j])); } }