Skip to content

Commit e12ff83

Browse files
Regenerate many tests (#302)
[no important files changed]
1 parent 61e3037 commit e12ff83

File tree

29 files changed

+34
-90
lines changed

29 files changed

+34
-90
lines changed

exercises/practice/affine-cipher/affine_cipher_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 0
2-
31
#include "vendor/unity.h"
42

53
#define BUFFER_SIZE 256

exercises/practice/all-your-base/all_your_base_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 0
2-
31
#include "stdint.h"
42
#include "vendor/unity.h"
53

exercises/practice/atbash-cipher/atbash_cipher_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 1.0.0
2-
31
#include "vendor/unity.h"
42

53
#define BUFFER_SIZE 256

exercises/practice/binary-search/binary_search_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 1.3.0
2-
31
#include "vendor/unity.h"
42

53
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

exercises/practice/bob/bob_test.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 0
2-
31
#include "vendor/unity.h"
42

53
extern const char *response(const char *hey_bob);
@@ -129,6 +127,12 @@ void test_alternate_silence(void) {
129127
TEST_ASSERT_EQUAL_STRING("Fine. Be that way!", response(str));
130128
}
131129

130+
void test_multiple_line_question(void) {
131+
TEST_IGNORE();
132+
char str[] = "\nDoes this cryogenic chamber make\n me look fat?";
133+
TEST_ASSERT_EQUAL_STRING("Sure.", response(str));
134+
}
135+
132136
void test_starting_with_whitespace(void) {
133137
TEST_IGNORE();
134138
char str[] = " hmmmmmmm...";
@@ -153,12 +157,6 @@ void test_nonquestion_ending_with_whitespace(void) {
153157
TEST_ASSERT_EQUAL_STRING("Whatever.", response(str));
154158
}
155159

156-
void test_multiple_line_question(void) {
157-
TEST_IGNORE();
158-
char str[] = "\nDoes this cryogenic chamber make\n me look fat?";
159-
TEST_ASSERT_EQUAL_STRING("Sure.", response(str));
160-
}
161-
162160
int main(void) {
163161
UNITY_BEGIN();
164162
RUN_TEST(test_stating_something);
@@ -181,10 +179,10 @@ int main(void) {
181179
RUN_TEST(test_silence);
182180
RUN_TEST(test_prolonged_silence);
183181
RUN_TEST(test_alternate_silence);
182+
RUN_TEST(test_multiple_line_question);
184183
RUN_TEST(test_starting_with_whitespace);
185184
RUN_TEST(test_ending_with_whitespace);
186185
RUN_TEST(test_other_whitespace);
187186
RUN_TEST(test_nonquestion_ending_with_whitespace);
188-
RUN_TEST(test_multiple_line_question);
189187
return UNITY_END();
190188
}

exercises/practice/book-store/book_store_test.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 0
2-
31
#include "stdint.h"
42
#include "vendor/unity.h"
53

@@ -26,8 +24,7 @@ void test_two_of_the_same_book(void) {
2624

2725
void test_empty_basket(void) {
2826
TEST_IGNORE();
29-
const int16_t *basket = NULL;
30-
TEST_ASSERT_EQUAL_INT(0, total(0, basket));
27+
TEST_ASSERT_EQUAL_INT(0, total(0, NULL));
3128
}
3229

3330
void test_two_different_books(void) {

exercises/practice/difference-of-squares/difference_of_squares_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 1.2.0
2-
31
#include "vendor/unity.h"
42

53
extern int square_of_sum(int number);
Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 1.2.0
2-
31
#include "vendor/unity.h"
42

53
extern uint64_t square(int64_t number);
@@ -11,51 +9,51 @@ void setUp(void) {
119
void tearDown(void) {
1210
}
1311

14-
void test_1(void) {
12+
void test_grains_on_square_1(void) {
1513
TEST_ASSERT_EQUAL_UINT64(UINT64_C(1), square(1));
1614
}
1715

18-
void test_2(void) {
16+
void test_grains_on_square_2(void) {
1917
TEST_IGNORE();
2018
TEST_ASSERT_EQUAL_UINT64(UINT64_C(2), square(2));
2119
}
2220

23-
void test_3(void) {
21+
void test_grains_on_square_3(void) {
2422
TEST_IGNORE();
2523
TEST_ASSERT_EQUAL_UINT64(UINT64_C(4), square(3));
2624
}
2725

28-
void test_4(void) {
26+
void test_grains_on_square_4(void) {
2927
TEST_IGNORE();
3028
TEST_ASSERT_EQUAL_UINT64(UINT64_C(8), square(4));
3129
}
3230

33-
void test_16(void) {
31+
void test_grains_on_square_16(void) {
3432
TEST_IGNORE();
3533
TEST_ASSERT_EQUAL_UINT64(UINT64_C(32768), square(16));
3634
}
3735

38-
void test_32(void) {
36+
void test_grains_on_square_32(void) {
3937
TEST_IGNORE();
4038
TEST_ASSERT_EQUAL_UINT64(UINT64_C(2147483648), square(32));
4139
}
4240

43-
void test_64(void) {
41+
void test_grains_on_square_64(void) {
4442
TEST_IGNORE();
4543
TEST_ASSERT_EQUAL_UINT64(UINT64_C(9223372036854775808), square(64));
4644
}
4745

48-
void test_square_0_raises_an_exception(void) {
46+
void test_square_0_is_invalid(void) {
4947
TEST_IGNORE();
5048
TEST_ASSERT_EQUAL_UINT64(UINT64_C(0), square(0));
5149
}
5250

53-
void test_negative_square_raises_an_exception(void) {
51+
void test_negative_square_is_invalid(void) {
5452
TEST_IGNORE();
5553
TEST_ASSERT_EQUAL_UINT64(UINT64_C(0), square(-1));
5654
}
5755

58-
void test_square_greater_than_64_raises_an_exception(void) {
56+
void test_square_greater_than_64_is_invalid(void) {
5957
TEST_IGNORE();
6058
TEST_ASSERT_EQUAL_UINT64(UINT64_C(0), square(65));
6159
}
@@ -67,16 +65,16 @@ void test_returns_the_total_number_of_grains_on_the_board(void) {
6765

6866
int main(void) {
6967
UNITY_BEGIN();
70-
RUN_TEST(test_1);
71-
RUN_TEST(test_2);
72-
RUN_TEST(test_3);
73-
RUN_TEST(test_4);
74-
RUN_TEST(test_16);
75-
RUN_TEST(test_32);
76-
RUN_TEST(test_64);
77-
RUN_TEST(test_square_0_raises_an_exception);
78-
RUN_TEST(test_negative_square_raises_an_exception);
79-
RUN_TEST(test_square_greater_than_64_raises_an_exception);
68+
RUN_TEST(test_grains_on_square_1);
69+
RUN_TEST(test_grains_on_square_2);
70+
RUN_TEST(test_grains_on_square_3);
71+
RUN_TEST(test_grains_on_square_4);
72+
RUN_TEST(test_grains_on_square_16);
73+
RUN_TEST(test_grains_on_square_32);
74+
RUN_TEST(test_grains_on_square_64);
75+
RUN_TEST(test_square_0_is_invalid);
76+
RUN_TEST(test_negative_square_is_invalid);
77+
RUN_TEST(test_square_greater_than_64_is_invalid);
8078
RUN_TEST(test_returns_the_total_number_of_grains_on_the_board);
8179
return UNITY_END();
8280
}

exercises/practice/hello-world/hello_world_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 1.1.0
2-
31
#include "vendor/unity.h"
42

53
extern const char *hello(void);

exercises/practice/kindergarten-garden/kindergarten_garden_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Version: 0
2-
31
#include "vendor/unity.h"
42

53
#define BUFFER_SIZE 80

0 commit comments

Comments
 (0)