Sha256: 67cbc2822ff7ee05b4c15c5452d578ee3979e57338e6ce5d375cf84377027d24

Contents?: true

Size: 1015 Bytes

Versions: 81

Compression:

Stored size: 1015 Bytes

Contents

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

void test_square_1(void)
{
   TEST_ASSERT_EQUAL_UINT64(1ul, square(1));
}

void test_square_2(void)
{
   TEST_ASSERT_EQUAL_UINT64(2ul, square(2));
}

void test_square_3(void)
{
   TEST_ASSERT_EQUAL_UINT64(4ul, square(3));
}

void test_square_4(void)
{
   TEST_ASSERT_EQUAL_UINT64(8ul, square(4));
}

void test_square_16(void)
{
   TEST_ASSERT_EQUAL_UINT64(32768ul, square(16));
}

void test_square_32(void)
{
   TEST_ASSERT_EQUAL_UINT64(2147483648ul, square(32));
}

void test_square_64(void)
{
   TEST_ASSERT_EQUAL_UINT64(9223372036854775808ul, square(64));
}

void test_total(void)
{
   TEST_ASSERT_EQUAL_UINT64(18446744073709551615ul, total());
}

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

   RUN_TEST(test_square_1);
   RUN_TEST(test_square_2);
   RUN_TEST(test_square_3);
   RUN_TEST(test_square_4);
   RUN_TEST(test_square_16);
   RUN_TEST(test_square_32);
   RUN_TEST(test_square_64);
   RUN_TEST(test_total);

   UnityEnd();
   return 0;
}

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
trackler-2.0.6.25 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.24 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.23 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.22 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.21 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.20 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.19 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.18 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.17 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.16 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.15 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.14 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.13 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.12 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.11 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.10 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.9 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.8 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.7 tracks/c/exercises/grains/test/test_grains.c
trackler-2.0.6.6 tracks/c/exercises/grains/test/test_grains.c