Skip to content

Commit 794e68f

Browse files
committed
Address PR comments
1 parent ac041b2 commit 794e68f

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

exercises/practice/pop-count/.meta/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "pop_count.h"
22

3-
int egg_count(int value)
3+
unsigned int egg_count(unsigned int value)
44
{
5-
int count = 0;
5+
unsigned int count = 0;
66
while (value != 0) {
77
count += value & 1;
88
value = value >> 1;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef POP_COUNT_H
22
#define POP_COUNT_H
33

4-
int egg_count(int value);
4+
unsigned int egg_count(unsigned int value);
55

66
#endif

exercises/practice/pop-count/test_pop_count.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,37 @@ void tearDown(void)
1111

1212
static void test_0_eggs(void)
1313
{
14-
const int expected = 0;
14+
const unsigned int expected = 0;
1515
TEST_ASSERT_EQUAL_INT(expected, egg_count(0));
1616
}
1717

1818
static void test_1_eggs(void)
1919
{
20+
TEST_IGNORE();
2021
const int expected = 1;
2122
TEST_ASSERT_EQUAL_INT(expected, egg_count(16));
2223
}
2324

2425
static void test_4_eggs(void)
2526
{
27+
TEST_IGNORE();
2628
const int expected = 4;
2729
TEST_ASSERT_EQUAL_INT(expected, egg_count(89));
2830
}
2931

3032
static void test_13_eggs(void)
3133
{
34+
TEST_IGNORE();
3235
const int expected = 13;
3336
TEST_ASSERT_EQUAL_INT(expected, egg_count(2000000000));
3437
}
3538

3639
int main(void)
3740
{
38-
UnityBegin("test_prime_factors.c");
41+
UnityBegin("test_pop_count.c");
3942

4043
RUN_TEST(test_0_eggs);
44+
4145
RUN_TEST(test_1_eggs);
4246
RUN_TEST(test_4_eggs);
4347
RUN_TEST(test_13_eggs);

0 commit comments

Comments
 (0)