@ -0,0 +1,5 @@
#include "add.h"
int add(int a, int b) {
return a + b;
}
@ -0,0 +1,4 @@
#ifndef SOME_H
#define SOME_H
int add(int a, int b);
#endif
@ -0,0 +1,10 @@
#include "../userinput.h"
#include <stdio.h>
int main() {
printf("add two numbers:\n");
int firstNum = getd("first number: ", NULL, NULL);
int secondNum = getd("second number: ", NULL, NULL);
printf("The result is: %d\n", add(firstNum, secondNum));
@ -0,0 +1,9 @@
#include "unity.h"
void setUp(void){}
void tearDown(void){}
void test_add(void) {
TEST_ASSERT_EQUAL_INT(100, add(50, 50));