Skip to content

Commit 2efc193

Browse files
committed
Adding test code for 'isUpperCase'
1 parent 1fcfa7f commit 2efc193

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Diff for: test/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set(TEST_TARGET ${CMAKE_PROJECT_NAME})
2525

2626
set(TEST_SRCS
2727
src/WCharacter/test_isHexadecimalDigit.cpp
28+
src/WCharacter/test_isUpperCase.cpp
2829
)
2930

3031
set(TEST_DUT_SRCS

Diff for: test/src/WCharacter/test_isUpperCase.cpp

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2020 Arduino. All rights reserved.
3+
*/
4+
5+
/**************************************************************************************
6+
* INCLUDE
7+
**************************************************************************************/
8+
9+
#include <catch.hpp>
10+
11+
#include <WCharacter.h>
12+
13+
/**************************************************************************************
14+
* TEST CODE
15+
**************************************************************************************/
16+
17+
TEST_CASE ("isUpperCase(...) is called with a upper case number", "[isUpperCase-01]")
18+
{
19+
REQUIRE(arduino::isUpperCase('A') == true);
20+
}
21+
22+
TEST_CASE ("isUpperCase(...) is called with a lower case number", "[isUpperCase-02]")
23+
{
24+
REQUIRE(arduino::isUpperCase('a') == false);
25+
}
26+
27+
TEST_CASE ("isUpperCase(...) is called with a non-alphabetic number", "[isUpperCase-03]")
28+
{
29+
REQUIRE(arduino::isUpperCase('0') == false);
30+
}

0 commit comments

Comments
 (0)