Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 2b84cd1

Browse files
committed
Fix unit tests
1 parent 7fbfe1f commit 2b84cd1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/src/test_decode.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ SCENARIO("Arduino Cloud Properties are decoded", "[ArduinoCloudThing::decode]")
5656
thing.begin();
5757

5858
CloudBool test = true;
59-
thing.addPropertyReal(test, "test", Permission::ReadWrite);
59+
thing.addPropertyReal(test, "test", Permission::ReadWrite, 1);
6060

61-
/* [{0: "test", 4: false}] = 81 A2 00 01 04 F4 */
61+
/* [{0: 1, 4: false}] = 81 A2 00 01 04 F4 */
6262
uint8_t const payload[] = {0x81, 0xA2, 0x00, 0x01, 0x04, 0xF4};
6363
int const payload_length = sizeof(payload) / sizeof(uint8_t);
6464
thing.decode(payload, payload_length);
@@ -192,9 +192,9 @@ SCENARIO("Arduino Cloud Properties are decoded", "[ArduinoCloudThing::decode]")
192192

193193
CloudColor color_test = CloudColor(0.0, 0.0, 0.0);
194194

195-
thing.addPropertyReal(color_test, "test", Permission::ReadWrite);
195+
thing.addPropertyReal(color_test, "test", Permission::ReadWrite, 1);
196196

197-
/* [{0: "test:hue", 2: 2.0},{0: "test:sat", 2: 2.0},{0: "test:bri", 2: 2.0}] = 83 A2 00 19 01 01 02 FA 40 00 00 00 A2 00 19 02 01 02 FA 40 00 00 00 A2 00 19 03 01 02 FA 40 00 00 00 */
197+
/* [{0: 257, 2: 2.0},{0: 513, 2: 2.0},{0: 769, 2: 2.0}] = 83 A2 00 19 01 01 02 FA 40 00 00 00 A2 00 19 02 01 02 FA 40 00 00 00 A2 00 19 03 01 02 FA 40 00 00 00 */
198198
uint8_t const payload[] = {0x83, 0xA2, 0x00, 0x19, 0x01, 0x01, 0x02, 0xFA, 0x40, 0x00, 0x00, 0x00, 0xA2, 0x00, 0x19, 0x02, 0x01, 0x02, 0xFA, 0x40, 0x00, 0x00, 0x00, 0xA2, 0x00, 0x19, 0x03, 0x01, 0x02, 0xFA, 0x40, 0x00, 0x00, 0x00 };
199199
thing.decode(payload, sizeof(payload) / sizeof(uint8_t));
200200

test/src/test_encode.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ SCENARIO("Arduino Cloud Properties are encoded", "[ArduinoCloudThing::encode]")
4747
encode(thing);
4848

4949
CloudBool test = true;
50-
thing.addPropertyReal(test, "test", Permission::ReadWrite);
50+
thing.addPropertyReal(test, "test", Permission::ReadWrite, 1);
5151

52-
/* [{0: "test", 4: true}] = 9F A2 00 01 04 F5 FF*/
52+
/* [{0: 1, 4: true}] = 9F A2 00 01 04 F5 FF*/
5353
std::vector<uint8_t> const expected = {0x9F, 0xA2, 0x00, 0x01, 0x04, 0xF5, 0xFF};
5454
std::vector<uint8_t> const actual = encode(thing, true);
5555
REQUIRE(actual == expected);
@@ -156,9 +156,9 @@ SCENARIO("Arduino Cloud Properties are encoded", "[ArduinoCloudThing::encode]")
156156
encode(thing);
157157

158158
CloudColor color_test = CloudColor(2.0, 2.0, 2.0);
159-
thing.addPropertyReal(color_test, "test", Permission::ReadWrite);
159+
thing.addPropertyReal(color_test, "test", Permission::ReadWrite, 1);
160160

161-
/* [{0: "test:hue", 2: 2.0},{0: "test:sat", 2: 2.0},{0: "test:bri", 2: 2.0}] = 9F A2 00 19 01 01 02 FA 40 00 00 00 A2 00 19 02 01 02 FA 40 00 00 00 A2 00 19 03 01 02 FA 40 00 00 00 FF*/
161+
/* [{0: 257, 2: 2.0},{0: 513, 2: 2.0},{0: 769, 2: 2.0}] = 9F A2 00 19 01 01 02 FA 40 00 00 00 A2 00 19 02 01 02 FA 40 00 00 00 A2 00 19 03 01 02 FA 40 00 00 00 FF*/
162162
std::vector<uint8_t> const expected = {0x9F, 0xA2, 0x00, 0x19, 0x01, 0x01, 0x02, 0xFA, 0x40, 0x00, 0x00, 0x00, 0xA2, 0x00, 0x19, 0x02, 0x01, 0x02, 0xFA, 0x40, 0x00, 0x00, 0x00, 0xA2, 0x00, 0x19, 0x03, 0x01, 0x02, 0xFA, 0x40, 0x00, 0x00, 0x00, 0xFF };
163163
std::vector<uint8_t> const actual = encode(thing, true);
164164
REQUIRE(actual == expected);

0 commit comments

Comments
 (0)