Sha256: 8adc47dfc3f036eba893fcda558d6854f4239b50f39be3c3e7ebed2a70e07b80

Contents?: true

Size: 1.57 KB

Versions: 260

Compression:

Stored size: 1.57 KB

Contents

#include "vendor/unity.h"
#include "../src/difference_of_squares.h"

void test_square_of_sum_up_to_5(void)
{
   TEST_ASSERT_EQUAL(225, square_of_sum(5));
}

void test_square_of_sum_up_to_10(void)
{
   TEST_ASSERT_EQUAL(3025, square_of_sum(10));
}

void test_square_of_sum_up_to_100(void)
{
   TEST_ASSERT_EQUAL(25502500, square_of_sum(100));
}

void test_sum_of_squares_up_to_5(void)
{
   TEST_ASSERT_EQUAL(55, sum_of_squares(5));
}

void test_sum_of_squares_up_to_10(void)
{
   TEST_ASSERT_EQUAL(385, sum_of_squares(10));
}

void test_sum_of_squares_up_to_100(void)
{
   TEST_ASSERT_EQUAL(338350, sum_of_squares(100));
}

void test_difference_of_squares_up_to_0(void)
{
   TEST_ASSERT_EQUAL(0, difference_of_squares(0));
}

void test_difference_of_squares_up_to_5(void)
{
   TEST_ASSERT_EQUAL(170, difference_of_squares(5));
}

void test_difference_of_squares_up_to_10(void)
{
   TEST_ASSERT_EQUAL(2640, difference_of_squares(10));
}

void test_difference_of_squares_up_to_100(void)
{
   TEST_ASSERT_EQUAL(25164150, difference_of_squares(100));
}

int main(void)
{
   UnityBegin("test/test_difference_of_squares.c");

   RUN_TEST(test_square_of_sum_up_to_5);
   RUN_TEST(test_square_of_sum_up_to_10);
   RUN_TEST(test_square_of_sum_up_to_100);
   RUN_TEST(test_sum_of_squares_up_to_5);
   RUN_TEST(test_sum_of_squares_up_to_10);
   RUN_TEST(test_sum_of_squares_up_to_100);
   RUN_TEST(test_difference_of_squares_up_to_0);
   RUN_TEST(test_difference_of_squares_up_to_5);
   RUN_TEST(test_difference_of_squares_up_to_10);
   RUN_TEST(test_difference_of_squares_up_to_100);

   UnityEnd();
   return 0;
}

Version data entries

260 entries across 260 versions & 1 rubygems

Version Path
trackler-2.2.1.42 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.41 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.40 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.39 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.38 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.37 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.36 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.35 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.34 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.33 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.32 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.31 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.30 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.29 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.28 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.27 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.26 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.25 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.24 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c
trackler-2.2.1.23 tracks/c/exercises/difference-of-squares/test/test_difference_of_squares.c