-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dba3890
commit 546abd5
Showing
5 changed files
with
3,358 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,54 @@ | ||
#include <assert.h> | ||
#include <inttypes.h> | ||
#include "vendor/unity.h" | ||
|
||
int64_t expected_minutes_in_oven(void); | ||
int64_t remaining_minutes_in_oven(int64_t actual_minutes_in_oven); | ||
int64_t preparation_time_in_minutes(int64_t number_of_layers); | ||
int64_t elapsed_time_in_minutes(int64_t number_of_layers, int64_t actual_minutes_in_oven); | ||
#include <stdint.h> | ||
|
||
extern int64_t expected_minutes_in_oven(void); | ||
extern int64_t remaining_minutes_in_oven(int64_t actual_minutes_in_oven); | ||
extern int64_t preparation_time_in_minutes(int64_t number_of_layers); | ||
extern int64_t elapsed_time_in_minutes(int64_t number_of_layers, int64_t actual_minutes_in_oven); | ||
|
||
void setUp(void) { | ||
} | ||
|
||
void tearDown(void) { | ||
} | ||
|
||
void test_expected(void) { | ||
TEST_ASSERT_EQUAL_INT64(40, expected_minutes_in_oven()); | ||
} | ||
|
||
void test_remaining(void) { | ||
TEST_IGNORE(); | ||
TEST_ASSERT_EQUAL_INT64(15, remaining_minutes_in_oven(25)); | ||
} | ||
|
||
void test_preparation_one(void) { | ||
TEST_IGNORE(); | ||
TEST_ASSERT_EQUAL_INT64(2, preparation_time_in_minutes(1)); | ||
} | ||
|
||
void test_preparation_many(void) { | ||
TEST_IGNORE(); | ||
TEST_ASSERT_EQUAL_INT64(8, preparation_time_in_minutes(4)); | ||
} | ||
|
||
void test_elapsed_one(void) { | ||
TEST_IGNORE(); | ||
TEST_ASSERT_EQUAL_INT64(32, elapsed_time_in_minutes(1, 30)); | ||
} | ||
|
||
void test_elapsed_many(void) { | ||
TEST_IGNORE(); | ||
TEST_ASSERT_EQUAL_INT64(16, elapsed_time_in_minutes(4, 8)); | ||
} | ||
|
||
int main(void) { | ||
assert(40 == expected_minutes_in_oven()); | ||
assert(15 == remaining_minutes_in_oven(25)); | ||
assert(2 == preparation_time_in_minutes(1)); | ||
assert(8 == preparation_time_in_minutes(4)); | ||
assert(32 == elapsed_time_in_minutes(1, 30)); | ||
assert(16 == elapsed_time_in_minutes(4, 8)); | ||
return 0; | ||
UNITY_BEGIN(); | ||
RUN_TEST(test_expected); | ||
RUN_TEST(test_remaining); | ||
RUN_TEST(test_preparation_one); | ||
RUN_TEST(test_preparation_many); | ||
RUN_TEST(test_elapsed_one); | ||
RUN_TEST(test_elapsed_many); | ||
return UNITY_END(); | ||
} |
Oops, something went wrong.