Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit73550eb

Browse files
committed
Add test cases for String::toInt() and String::toDouble() with invalid buffer
1 parent1cf220b commit73550eb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎test/src/String/test_toDouble.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ TEST_CASE ("Testing String::toDouble when string contains a number", "[String-to
3434
doubleconst val = str.toDouble();
3535
REQUIRE(val == -1.2345);
3636
}
37+
38+
TEST_CASE ("Testing String::toDouble when string does not have a buffer","[String-toDouble-04]")
39+
{
40+
char *buffer =NULL;
41+
arduino::Stringstr(buffer);
42+
REQUIRE(str.toDouble() ==0);
43+
}

‎test/src/String/test_toInt.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ TEST_CASE ("Testing String::toInt when string contains a number", "[String-toInt
3434
intconst val = str.toInt();
3535
REQUIRE(val == -1);
3636
}
37+
38+
TEST_CASE ("Testing String::toInt when string does not have a buffer","[String-toInt-04]")
39+
{
40+
char *buffer =NULL;
41+
arduino::Stringstr(buffer);
42+
REQUIRE(str.toInt() ==0);
43+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp