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

Commitd2c8b2e

Browse files
committed
Add test code for & String::operator[]
1 parent73550eb commitd2c8b2e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎test/src/String/test_characterAccessFunc.cpp‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,18 @@ TEST_CASE ("Testing String::getBytes(unsigned char, unsigned int, unsigned int)"
4949
REQUIRE(buf[1] =='o');
5050
}
5151
}
52+
53+
TEST_CASE ("Testing & String::operator[]","[String-&operator[]-03]")
54+
{
55+
arduino::Stringstr("Hello");
56+
str[0] ='M';
57+
REQUIRE(str =="Mello");
58+
}
59+
60+
TEST_CASE ("Testing & String::operator[] with invalid buffer","[String-&operator[]-04]")
61+
{
62+
char *buffer =NULL;
63+
arduino::Stringstr(buffer);
64+
str[0] ='M';
65+
REQUIRE(str[0] ==0);
66+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp