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:
parent
1be6bd7567
commit
d3e7150bac
@ -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)
|
||||
|
@ -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__":
|
||||
|
Loading…
Reference in New Issue
Block a user