|
|
@ -4,7 +4,7 @@ |
|
|
|
|
|
|
|
#include "addition.h" |
|
|
|
|
|
|
|
int carry[1]; |
|
|
|
num carry[1]; |
|
|
|
|
|
|
|
void setUp(void) |
|
|
|
{ |
|
|
@ -16,8 +16,8 @@ void tearDown(void) |
|
|
|
|
|
|
|
void test_addition_full_adder_nullplusnullgleichnull(void) |
|
|
|
{ |
|
|
|
unsigned int result[1]; |
|
|
|
unsigned int expected = 0; |
|
|
|
num result[1]; |
|
|
|
num expected = 0; |
|
|
|
|
|
|
|
full_adder(result, carry, 0, 0, 0); |
|
|
|
|
|
|
@ -26,8 +26,8 @@ void test_addition_full_adder_nullplusnullgleichnull(void) |
|
|
|
|
|
|
|
void test_addition_full_adder_nullplusnullgleichnullmituebertrag(void) |
|
|
|
{ |
|
|
|
unsigned int result[1]; |
|
|
|
unsigned int expected = 1; |
|
|
|
num result[1]; |
|
|
|
num expected = 1; |
|
|
|
|
|
|
|
full_adder(result, carry, 0, 0, 1); |
|
|
|
|
|
|
@ -36,8 +36,8 @@ void test_addition_full_adder_nullplusnullgleichnullmituebertrag(void) |
|
|
|
|
|
|
|
void test_addition_full_adder_zahlpluszahlgleichsummeohneuebertrag(void) |
|
|
|
{ |
|
|
|
unsigned int result[5]; |
|
|
|
unsigned int expected[5] = { 0, 1, 1, 1, 1}; |
|
|
|
num result[5]; |
|
|
|
num expected[5] = { 0, 1, 1, 1, 1}; |
|
|
|
|
|
|
|
full_adder((result+0), carry, 1, 0, 1); |
|
|
|
full_adder((result+1), carry, 0, 1, 0); |
|
|
@ -54,8 +54,8 @@ void test_addition_full_adder_zahlpluszahlgleichsummeohneuebertrag(void) |
|
|
|
|
|
|
|
void test_addition_full_adder_completesumwithcarry(void) |
|
|
|
{ |
|
|
|
unsigned int result[5], carryresult[5]; |
|
|
|
unsigned int expected[5] = { 0, 0, 1, 1, 0}, expectedcarry[5] = { 1, 1, 1, 0, 0}; |
|
|
|
num result[5], carryresult[5]; |
|
|
|
num expected[5] = { 0, 0, 1, 1, 0}, expectedcarry[5] = { 1, 1, 1, 0, 0}; |
|
|
|
|
|
|
|
full_adder(result+0, carryresult+0, 0, 1, 1); |
|
|
|
full_adder(result+1, carryresult+1, 1, 1, 0); |
|
|
|