|
|
@ -82,7 +82,7 @@ void test_addition_full_adder_completesumwithcarry(void) |
|
|
|
TEST_ASSERT_EQUAL_UINT(expectedcarry[4], carryresult[4]); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_addition_basecasezeropluszeroequalzero(void) |
|
|
|
void test_addition_addition_uint_basecasezeropluszeroequalzero(void) |
|
|
|
{ |
|
|
|
unsigned int result; |
|
|
|
unsigned int expected = 0; |
|
|
@ -92,7 +92,7 @@ void test_addition_addition_basecasezeropluszeroequalzero(void) |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected, result); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_addition_basecaseonescolumns(void) |
|
|
|
void test_addition_addition_uint_basecaseonescolumns(void) |
|
|
|
{ |
|
|
|
unsigned int result[2]; |
|
|
|
unsigned int expected[2] = { 1, 1 }; |
|
|
@ -104,7 +104,7 @@ void test_addition_addition_basecaseonescolumns(void) |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_addition_basecasetotenscolumns(void) |
|
|
|
void test_addition_addition_uint_basecasetotenscolumns(void) |
|
|
|
{ |
|
|
|
unsigned int result[5]; |
|
|
|
unsigned int expected[5] = { 3, 3, 2, 3, 3 }; |
|
|
@ -122,7 +122,7 @@ void test_addition_addition_basecasetotenscolumns(void) |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[4], result[4]); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_addition_allunsignedinteger(void) |
|
|
|
void test_addition_addition_uint_allunsignedinteger(void) |
|
|
|
{ |
|
|
|
unsigned int result[5]; |
|
|
|
unsigned int expected[5] = { 88879736, __UINT32_MAX__, 66558, __UINT32_MAX__, 477905879 }; |
|
|
@ -140,7 +140,7 @@ void test_addition_addition_allunsignedinteger(void) |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[4], result[4]); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_signfloatingnumber(void) |
|
|
|
void test_addition_sign_floatingnumber(void) |
|
|
|
{ |
|
|
|
unsigned int result[2]; |
|
|
|
unsigned int expected[2] = { 0, 1 }; |
|
|
@ -153,7 +153,7 @@ void test_addition_signfloatingnumber(void) |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_precisionfloatingnumber(void) |
|
|
|
void test_addition_precision_floatingnumber(void) |
|
|
|
{ |
|
|
|
unsigned int result[5]; |
|
|
|
number[0].floating = 0, number[1].floating = -34753168, number[2].floating = 75613594, number[3].floating = -0.00000044568721, number[4].floating = 0.0000004796123; |
|
|
@ -172,7 +172,7 @@ void test_addition_precisionfloatingnumber(void) |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[4], result[4]); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_exponentfloatingnumber(void) |
|
|
|
void test_addition_exponent_floatingnumber(void) |
|
|
|
{ |
|
|
|
unsigned int result[5]; |
|
|
|
number[0].floating = 0, number[1].floating = -762134982, number[2].floating = 47621349, number[3].floating = -0.0000078961354, number[4].floating = 0.00001568943; |
|
|
@ -191,7 +191,7 @@ void test_addition_exponentfloatingnumber(void) |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[4], result[4]); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_addition_precision_positivnumberlowerthan2tothepowerof24(void) |
|
|
|
void test_addition_addition_precision_float_positivnumberlowerthan2tothepowerof24(void) |
|
|
|
{ |
|
|
|
unsigned int result[2]; |
|
|
|
number[0].floating = 652468761.2348, number[1].floating = 2.675312546943, number[2].floating = 321647956212.2146, number[3].floating = 0.00000324567861, number[4].floating = number[0].floating + number[1].floating; number[5].floating = number[2].floating + number[3].floating; |
|
|
@ -211,7 +211,7 @@ void test_addition_addition_precision_positivnumberlowerthan2tothepowerof24(void |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
|
|
} |
|
|
|
|
|
|
|
void test_addition_output_numberwithsignexponentprecision(void) |
|
|
|
void test_addition_output_float_numberwithsignexponentprecision(void) |
|
|
|
{ |
|
|
|
unsigned int result[5]; |
|
|
|
number[0].floating = 1468921, number[1].floating = -32468127698, number[2].floating = 0.000000795311468, number[3].floating = -0.00000843214521, number[4].floating = 14; |
|
|
|