From db0bcfff980f055a3ef0298ddde554a934fb6c88 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Fri, 7 Feb 2014 13:06:17 +0200 Subject: [PATCH] Update unit tests. - Vectors that point far outside the frame don't work, although the special case of them pointing right beside the frame works. So test for vectors pointing farther away. - Update include directory for greatest. --- build/C_Properties.props | 2 +- tests/sad_tests.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/build/C_Properties.props b/build/C_Properties.props index f6a04ba5..e231b43a 100644 --- a/build/C_Properties.props +++ b/build/C_Properties.props @@ -13,7 +13,7 @@ AssemblyAndSourceCode MultiThreadedDebugDLL WIN32;WIN64;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(SolutionDir)..;$(SolutionDir)..\src;%(AdditionalIncludeDirectories) + $(SolutionDir)..\src;$(SolutionDir)..\;%(AdditionalIncludeDirectories) Ws2_32.lib;%(AdditionalDependencies) diff --git a/tests/sad_tests.c b/tests/sad_tests.c index 7c0787b0..2af876bb 100644 --- a/tests/sad_tests.c +++ b/tests/sad_tests.c @@ -136,11 +136,12 @@ TEST test_bottomright(void) ////////////////////////////////////////////////////////////////////////// // OUT OF FRAME TESTS +#define DIST 10 TEST test_topleft_out(void) { ASSERT_EQ( 1*(8*8) - 64, - TEST_SAD(-8, -8)); + TEST_SAD(-DIST, -DIST)); PASS(); } @@ -148,7 +149,7 @@ TEST test_top_out(void) { ASSERT_EQ( (1+3)*8 + 2*(6*8) - 64, - TEST_SAD(0, -8)); + TEST_SAD(0, -DIST)); PASS(); } @@ -156,7 +157,7 @@ TEST test_topright_out(void) { ASSERT_EQ( 3*(8*8) - 64, - TEST_SAD(8, -8)); + TEST_SAD(DIST, -DIST)); PASS(); } @@ -164,7 +165,7 @@ TEST test_left_out(void) { ASSERT_EQ( (1+7)*8 + 4*(6*8) - 64, - TEST_SAD(-8, 0)); + TEST_SAD(-DIST, 0)); PASS(); } @@ -172,7 +173,7 @@ TEST test_right_out(void) { ASSERT_EQ( (3+9)*8 + 6*(6*8) - 64, - TEST_SAD(8, 0)); + TEST_SAD(DIST, 0)); PASS(); } @@ -180,7 +181,7 @@ TEST test_bottomleft_out(void) { ASSERT_EQ( 7*(8*8) - 64, - TEST_SAD(-8, 8)); + TEST_SAD(-DIST, DIST)); PASS(); } @@ -188,7 +189,7 @@ TEST test_bottom_out(void) { ASSERT_EQ( (7+9)*8 + 8*(6*8) - 64, - TEST_SAD(0, 8)); + TEST_SAD(0, DIST)); PASS(); } @@ -196,7 +197,7 @@ TEST test_bottomright_out(void) { ASSERT_EQ( 9*(8*8) - 64, - TEST_SAD(8, 8)); + TEST_SAD(DIST, DIST)); PASS(); }