1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/sys_arduino: add test case to print float values

This commit is contained in:
Alexandre Abadie 2020-10-27 15:32:06 +01:00
parent 1be6bd7567
commit d3e7150bac
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 14 additions and 0 deletions

View File

@ -105,6 +105,15 @@ static void print_test(void)
Serial.print("): ");
Serial.println(ul, f);
}
Serial.print("print(float): ");
Serial.print((float)3.1415);
Serial.println();
for (int i = 0; i < 4; i++) {
Serial.print("print(float): ");
Serial.print((float)3.1415, i);
Serial.println();
}
}
void loop(void)

View File

@ -64,6 +64,11 @@ def testfunc(child):
child.expect_exact("println(unsigned long, DEC): 1234567890")
child.expect_exact("print(unsigned long, HEX): 499602d2")
child.expect_exact("println(unsigned long, HEX): 499602d2")
child.expect_exact("print(float): 3.14")
child.expect_exact("print(float): 3")
child.expect_exact("print(float): 3.1")
child.expect_exact("print(float): 3.14")
child.expect_exact("print(float): 3.141")
if __name__ == "__main__":