forked from arduino/ArduinoCore-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_makeWord.cpp
32 lines (25 loc) · 860 Bytes
/
test_makeWord.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* Copyright (c) 2020 Arduino. All rights reserved.
*/
/**************************************************************************************
* INCLUDE
**************************************************************************************/
#include <catch.hpp>
#include <api/Common.h>
/**************************************************************************************
* TEST CODE
**************************************************************************************/
TEST_CASE ("Calling 'makeWord(w)'", "[makeWord-01]")
{
REQUIRE(makeWord(0xDEAD) == 0xDEAD);
REQUIRE(makeWord(0xDE) == 0x00DE);
}
TEST_CASE ("Calling 'makeWord(h,l)'", "[makeWord-02]")
{
REQUIRE(makeWord(0xDE, 0xAD) == 0xDEAD);
}
TEST_CASE ("Calling 'word(...)'", "[makeWord-03]")
{
REQUIRE(word(0xDEAD) == 0xDEAD);
REQUIRE(word(0xDE, 0xAD) == 0xDEAD);
}