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

Commit6d9db81

Browse files
committed
Test String(const __FlashStringHelper) constructor() with invalid buffer
1 parentd2c8b2e commit6d9db81

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎test/src/String/test_String.cpp‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,13 @@ TEST_CASE ("Testing String(double, unsigned char decimalPlaces = 2) constructor(
9191
arduino::Stringstr(val);
9292
REQUIRE(strcmp(str.c_str(),"5.68") ==0);
9393
}
94+
95+
TEST_CASE ("Testing String(const __FlashStringHelper) constructor() with invalid buffer","[String-Ctor-12]")
96+
{
97+
#undef F
98+
#defineF(string_literal) (reinterpret_cast<const arduino::__FlashStringHelper *>(PSTR(string_literal)))
99+
char *buffer =NULL;
100+
101+
arduino::Stringstr1(F(buffer));
102+
REQUIRE(str1.compareTo("Hello") ==0);
103+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp