8000 Adding test code for String::toLowerCase/toUpperCase · arduino/ArduinoCore-API@bf77b48 · GitHub
[go: up one dir, main page]

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

Appearance settings

Commit bf77b48

Browse files
committed
Adding test code for String::toLowerCase/toUpperCase
1 parent cbec108 commit bf77b48

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ set(TEST_SRCS
4545
src/String/test_concat.cpp
4646
src/String/test_length.cpp
4747
src/String/test_String.cpp
48+
src/String/test_toLowerCase.cpp
49+
src/String/test_toUpperCase.cpp
4850
src/WCharacter/test_isControl.cpp
4951
src/WCharacter/test_isDigit.cpp
5052
src/WCharacter/test_isHexadecimalDigit.cpp

test/src/String/test_toLowerCase.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2020 Arduino. All rights reserved.
3+
*/
4+
5+
/**************************************************************************************
6+
* INCLUDE
7+
**************************************************************************************/
8+
9+
#include <catch.hpp>
10+
11+
#include <String.h>
12+
13+
/**************************************************************************************
14+
* TEST CODE
15+
**************************************************************************************/
16+
17+
TEST_CASE ("Testing String::toLowerCase", "[String-toLowerCase-01]")
18+
{
19+
arduino::String str("HELLO ARDUINO");
20+
str.toLowerCase();
21+
REQUIRE(strcmp(str.c_str(), "hello arduino") == 0);
22+
}

test/src/String/test_toUpperCase.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2020 Arduino. All rights reserved.
3+
*/
4+
5+
/**************************************************************************************
6+
* INCLUDE
7+
**************************************************************************************/
8+
9+
#include <catch.hpp>
10+
11+
#include <String.h>
12+
13+
/**************************************************************************************
14+
* TEST CODE
15+
**************************************************************************************/
16+
17+
TEST_CASE ("Testing String::toUpperCase", "[String-toUpperCase-01]")
18+
{
19+
arduino::String str("hello arduino");
20+
str.toUpperCase();
21+
REQUIRE(strcmp(str.c_str(), "HELLO ARDUINO") == 0);
22+
}

0 commit comments

Comments
 (0)
0