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

Commit5d4e194

Browse files
committed
Adding test code for IPAddress::operator()
1 parente1c65ce commit5d4e194

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

‎test/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ set(TEST_SRCS
3333
src/IPAddress/test_IPAddress.cpp
3434
src/IPAddress/test_operator_assignment.cpp
3535
src/IPAddress/test_operator_comparison.cpp
36+
src/IPAddress/test_operator_parentheses.cpp
3637
src/IPAddress/test_printTo.cpp
3738
src/Print/test_clearWriteError.cpp
3839
src/Print/test_getWriteError.cpp
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2020 Arduino. All rights reserved.
3+
*/
4+
5+
/**************************************************************************************
6+
* INCLUDE
7+
**************************************************************************************/
8+
9+
#include<catch.hpp>
10+
11+
#include<IPAddress.h>
12+
13+
/**************************************************************************************
14+
* TEST CODE
15+
**************************************************************************************/
16+
17+
TEST_CASE ("Testing IPAddress::operator uint32_t() const","[IPAddress-Operator-()-01]")
18+
{
19+
arduino::IPAddressip(129,168,1,2);
20+
uint32_tconst val_expected = ip;
21+
uint32_tconst val_actual = (129 | (168 <<8) | (1 <<16) | (2 <<24));
22+
REQUIRE(val_expected == val_actual);
23+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp