itoa unit test, not a very detailed one
This commit is contained in:
parent
696a1cd569
commit
51ade79641
|
@ -193,7 +193,6 @@ static char* itoa_signed(char *p, int num, unsigned radix) {
|
||||||
* @return pointer at the end zero symbol after the digits
|
* @return pointer at the end zero symbol after the digits
|
||||||
*/
|
*/
|
||||||
char* itoa10(char *p, int num) {
|
char* itoa10(char *p, int num) {
|
||||||
// todo: unit test
|
|
||||||
return itoa_signed(p, num, 10);
|
return itoa_signed(p, num, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ int maxI(int i1, int i2);
|
||||||
int minI(int i1, int i2);
|
int minI(int i1, int i2);
|
||||||
float maxF(float i1, float i2);
|
float maxF(float i1, float i2);
|
||||||
float minF(float i1, float i2);
|
float minF(float i1, float i2);
|
||||||
|
// sometimes known as 'itoa'
|
||||||
char* itoa10(char *p, int num);
|
char* itoa10(char *p, int num);
|
||||||
bool isSameF(float v1, float v2);
|
bool isSameF(float v1, float v2);
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,12 @@
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
#include "fl_stack.h"
|
#include "fl_stack.h"
|
||||||
|
|
||||||
|
TEST(util, testitoa) {
|
||||||
|
char buffer[12];
|
||||||
|
itoa10(buffer, 239);
|
||||||
|
ASSERT_TRUE(strEqual(buffer, "239"));
|
||||||
|
}
|
||||||
|
|
||||||
TEST(util, negativeZero) {
|
TEST(util, negativeZero) {
|
||||||
ASSERT_TRUE(IS_NEGATIVE_ZERO(-0.0));
|
ASSERT_TRUE(IS_NEGATIVE_ZERO(-0.0));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue