@ -0,0 +1,9 @@
#include "exponentials.h"
#include <stdlib.h>
#include <math.h>
double* exponentials_double(int base, int exponent) {
double* result = malloc(sizeof(double));
*result = pow(base, exponent);
return result;
}
@ -0,0 +1,6 @@
#ifndef THEADMIRALS_EXPONENTIALS_H
#define THEADMIRALS_EXPONENTIALS_H
double* exponentials_double(int, int);
#endif //THEADMIRALS_EXPONENTIALS_H
@ -0,0 +1,18 @@
#include "../src/exponentials.h"
#include "unity.h"
#include "limits.h"
void setUp(void) {
// set stuff up here
void tearDown(void) {
// clean stuff up here
void test_exponentials_calculatenumfrombaseandexponent(void) {
double expectedResult = 32.000000;
double* result;
result = exponentials_double(2, 5);
TEST_ASSERT_EQUAL_DOUBLE(expectedResult, *result);