95 char actual[] =
"HelWorl da12 dad%";
96 char expected[] =
"helworl da12 dad%";
99 ASSERT_EQ_MSG(0, strcmp(expected, actual));
104 TEST(ToLower_DoesNotFailOnEmpty) {
108 ASSERT_EQ_MSG(0, strlen(actual));
114 char actual[] =
"HelWorl da12 dad%";
115 char expected[] =
"HELWORL DA12 DAD%";
118 ASSERT_EQ_MSG(0, strcmp(expected, actual));
123 TEST(ToUpper_DoesNotFailOnEmpty) {
127 ASSERT_EQ_MSG(0, strlen(actual));
152 const double expected = log2(2356);
154 const double difference = fabs(actual - expected) / expected;
155 const bool withinRange = 0.0001 > difference;
156 ASSERT_TRUE(withinRange);
161 TEST(MeasureTimeInterval) {
162 const unsigned int expected = 1000;
164 unsigned int start = CNT;
165 waitcnt(expected * MILLISECOND + CNT);
167 ASSERT_EQ_MSG(expected, actual);
177 RUN_TEST(ToLower_DoesNotFailOnEmpty);
179 RUN_TEST(ToUpper_DoesNotFailOnEmpty);
182 RUN_TEST(MeasureTimeInterval);
static uint8_t count_bits(uint32_t par)
Count the number of set bits in a parameter.
Generic definitions and functions for the Parallax Propeller.
static int rom_log(int x)
Compute the mathematical expression log2(x). Result is in fixed-point format (16 digits to the left a...
static void to_upper(char string[])
Convert each alphabetical character in a null-terminated character array to uppercase letters...
static void to_lower(char string[])
Convert each alphabetical character in a null-terminated character array to lowercase letters...
static const char * to_string(const bool b)
Convert a boolean to the string-literal either "true" or "false"
static uint32_t measure_time_interval(const register uint32_t start)
Determine the number of microseconds passed since a starting point.