Skip to content

Commit ddf1b3f

Browse files
committed
Reverts downlink test sender function naming
1 parent 66557d2 commit ddf1b3f

File tree

3 files changed

+50
-50
lines changed

3 files changed

+50
-50
lines changed

swimos_downlink/src/task/tests/event.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async fn link_downlink() {
7575
|mut writer, reader| async move {
7676
let _reader = reader;
7777
writer
78-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
78+
.send_value::<i32>(DownlinkNotification::Linked)
7979
.await;
8080
expect_event(&mut event_rx, TestMessage::Linked).await;
8181
event_rx
@@ -104,10 +104,10 @@ async fn message_before_linked() {
104104
|mut writer, reader| async move {
105105
let _reader = reader;
106106
writer
107-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 9 })
107+
.send_value::<i32>(DownlinkNotification::Event { body: 9 })
108108
.await;
109109
writer
110-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
110+
.send_value::<i32>(DownlinkNotification::Linked)
111111
.await;
112112
expect_event(&mut event_rx, TestMessage::Linked).await;
113113
event_rx
@@ -136,10 +136,10 @@ async fn message_after_linked() {
136136
|mut writer, reader| async move {
137137
let _reader = reader;
138138
writer
139-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
139+
.send_value::<i32>(DownlinkNotification::Linked)
140140
.await;
141141
writer
142-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 9 })
142+
.send_value::<i32>(DownlinkNotification::Event { body: 9 })
143143
.await;
144144
expect_event(&mut event_rx, TestMessage::Linked).await;
145145
expect_event(&mut event_rx, TestMessage::Event(9)).await;
@@ -168,13 +168,13 @@ async fn terminate_after_unlinked() {
168168
config,
169169
|mut writer, reader| async move {
170170
writer
171-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
171+
.send_value::<i32>(DownlinkNotification::Linked)
172172
.await;
173173
writer
174-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 9 })
174+
.send_value::<i32>(DownlinkNotification::Event { body: 9 })
175175
.await;
176176
writer
177-
.send_scalar_value::<i32>(DownlinkNotification::Unlinked)
177+
.send_value::<i32>(DownlinkNotification::Unlinked)
178178
.await;
179179
expect_event(&mut event_rx, TestMessage::Linked).await;
180180
expect_event(&mut event_rx, TestMessage::Event(9)).await;
@@ -210,10 +210,10 @@ async fn terminate_after_corrupt_frame() {
210210
config,
211211
|mut writer, reader| async move {
212212
writer
213-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
213+
.send_value::<i32>(DownlinkNotification::Linked)
214214
.await;
215215
expect_event(&mut event_rx, TestMessage::Linked).await;
216-
writer.send_corrupted_scalar_frame().await;
216+
writer.send_corrupted_frame().await;
217217
(writer, reader, event_rx)
218218
},
219219
)
@@ -244,22 +244,22 @@ async fn relink_downlink() {
244244
|mut writer, reader| async move {
245245
let _reader = reader;
246246
writer
247-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
247+
.send_value::<i32>(DownlinkNotification::Linked)
248248
.await;
249249
writer
250-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 9 })
250+
.send_value::<i32>(DownlinkNotification::Event { body: 9 })
251251
.await;
252252
writer
253-
.send_scalar_value::<i32>(DownlinkNotification::Unlinked)
253+
.send_value::<i32>(DownlinkNotification::Unlinked)
254254
.await;
255255
writer
256-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 10 })
256+
.send_value::<i32>(DownlinkNotification::Event { body: 10 })
257257
.await;
258258
writer
259-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
259+
.send_value::<i32>(DownlinkNotification::Linked)
260260
.await;
261261
writer
262-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 11 })
262+
.send_value::<i32>(DownlinkNotification::Event { body: 11 })
263263
.await;
264264
expect_event(&mut event_rx, TestMessage::Linked).await;
265265
expect_event(&mut event_rx, TestMessage::Event(9)).await;

swimos_downlink/src/task/tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl TestReader {
9696
const BAD_UTF8: &[u8] = &[0xf0, 0x28, 0x8c, 0x28, 0x00, 0x00, 0x00];
9797

9898
impl TestValueWriter {
99-
async fn send_scalar_value<T>(&mut self, notification: DownlinkNotification<T>)
99+
async fn send_value<T>(&mut self, notification: DownlinkNotification<T>)
100100
where
101101
T: StructuralWritable,
102102
{
@@ -113,7 +113,7 @@ impl TestValueWriter {
113113
assert!(writer.send(raw).await.is_ok());
114114
}
115115

116-
async fn send_corrupted_scalar_frame(&mut self) {
116+
async fn send_corrupted_frame(&mut self) {
117117
let TestValueWriter(writer) = self;
118118
let bad = DownlinkNotification::Event { body: BAD_UTF8 };
119119
assert!(writer.send(bad).await.is_ok());

swimos_downlink/src/task/tests/value.rs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async fn link_downlink() {
9191
|mut writer, reader| async move {
9292
let _reader = reader;
9393
writer
94-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
94+
.send_value::<i32>(DownlinkNotification::Linked)
9595
.await;
9696
expect_event(&mut event_rx, TestMessage::Linked).await;
9797

@@ -122,10 +122,10 @@ async fn invalid_sync_downlink() {
122122
|mut writer, reader| async move {
123123
let _reader = reader;
124124
writer
125-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
125+
.send_value::<i32>(DownlinkNotification::Linked)
126126
.await;
127127
writer
128-
.send_scalar_value::<i32>(DownlinkNotification::Synced)
128+
.send_value::<i32>(DownlinkNotification::Synced)
129129
.await;
130130
expect_event(&mut event_rx, TestMessage::Linked).await;
131131
},
@@ -155,13 +155,13 @@ async fn sync_downlink() {
155155
let _reader = reader;
156156

157157
writer
158-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
158+
.send_value::<i32>(DownlinkNotification::Linked)
159159
.await;
160160
writer
161-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 5 })
161+
.send_value::<i32>(DownlinkNotification::Event { body: 5 })
162162
.await;
163163
writer
164-
.send_scalar_value::<i32>(DownlinkNotification::Synced)
164+
.send_value::<i32>(DownlinkNotification::Synced)
165165
.await;
166166
expect_event(&mut event_rx, TestMessage::Linked).await;
167167
expect_event(&mut event_rx, TestMessage::Synced(5)).await;
@@ -192,13 +192,13 @@ async fn report_events_before_sync() {
192192
|mut writer, reader| async move {
193193
let _reader = reader;
194194
writer
195-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
195+
.send_value::<i32>(DownlinkNotification::Linked)
196196
.await;
197197
writer
198-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 5 })
198+
.send_value::<i32>(DownlinkNotification::Event { body: 5 })
199199
.await;
200200
writer
201-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 67 })
201+
.send_value::<i32>(DownlinkNotification::Event { body: 67 })
202202
.await;
203203
expect_event(&mut event_rx, TestMessage::Linked).await;
204204
expect_event(&mut event_rx, TestMessage::Event(5)).await;
@@ -232,16 +232,16 @@ async fn report_events_after_sync() {
232232
|mut writer, reader| async move {
233233
let _reader = reader;
234234
writer
235-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
235+
.send_value::<i32>(DownlinkNotification::Linked)
236236
.await;
237237
writer
238-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 5 })
238+
.send_value::<i32>(DownlinkNotification::Event { body: 5 })
239239
.await;
240240
writer
241-
.send_scalar_value::<i32>(DownlinkNotification::Synced)
241+
.send_value::<i32>(DownlinkNotification::Synced)
242242
.await;
243243
writer
244-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 67 })
244+
.send_value::<i32>(DownlinkNotification::Event { body: 67 })
245245
.await;
246246
expect_event(&mut event_rx, TestMessage::Linked).await;
247247
expect_event(&mut event_rx, TestMessage::Synced(5)).await;
@@ -273,18 +273,18 @@ async fn terminate_after_unlinked() {
273273
config,
274274
|mut writer, reader| async move {
275275
writer
276-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
276+
.send_value::<i32>(DownlinkNotification::Linked)
277277
.await;
278278
writer
279-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 5 })
279+
.send_value::<i32>(DownlinkNotification::Event { body: 5 })
280280
.await;
281281
writer
282-
.send_scalar_value::<i32>(DownlinkNotification::Synced)
282+
.send_value::<i32>(DownlinkNotification::Synced)
283283
.await;
284284
expect_event(&mut event_rx, TestMessage::Linked).await;
285285
expect_event(&mut event_rx, TestMessage::Synced(5)).await;
286286
writer
287-
.send_scalar_value::<i32>(DownlinkNotification::Unlinked)
287+
.send_value::<i32>(DownlinkNotification::Unlinked)
288288
.await;
289289
expect_event(&mut event_rx, TestMessage::Unlinked).await;
290290
(writer, reader, event_rx)
@@ -319,10 +319,10 @@ async fn terminate_after_corrupt_frame() {
319319
config,
320320
|mut writer, reader| async move {
321321
writer
322-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
322+
.send_value::<i32>(DownlinkNotification::Linked)
323323
.await;
324324
expect_event(&mut event_rx, TestMessage::Linked).await;
325-
writer.send_corrupted_scalar_frame().await;
325+
writer.send_corrupted_frame().await;
326326
(writer, reader, event_rx)
327327
},
328328
)
@@ -354,22 +354,22 @@ async fn unlink_discards_value() {
354354
|mut writer, reader| async move {
355355
let _reader = reader;
356356
writer
357-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
357+
.send_value::<i32>(DownlinkNotification::Linked)
358358
.await;
359359
writer
360-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 5 })
360+
.send_value::<i32>(DownlinkNotification::Event { body: 5 })
361361
.await;
362362
writer
363-
.send_scalar_value::<i32>(DownlinkNotification::Synced)
363+
.send_value::<i32>(DownlinkNotification::Synced)
364364
.await;
365365
writer
366-
.send_scalar_value::<i32>(DownlinkNotification::Unlinked)
366+
.send_value::<i32>(DownlinkNotification::Unlinked)
367367
.await;
368368
writer
369-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
369+
.send_value::<i32>(DownlinkNotification::Linked)
370370
.await;
371371
writer
372-
.send_scalar_value::<i32>(DownlinkNotification::Synced)
372+
.send_value::<i32>(DownlinkNotification::Synced)
373373
.await;
374374
expect_event(&mut event_rx, TestMessage::Linked).await;
375375
expect_event(&mut event_rx, TestMessage::Synced(5)).await;
@@ -400,25 +400,25 @@ async fn relink_downlink() {
400400
|mut writer, reader| async move {
401401
let _reader = reader;
402402
writer
403-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
403+
.send_value::<i32>(DownlinkNotification::Linked)
404404
.await;
405405
writer
406-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 5 })
406+
.send_value::<i32>(DownlinkNotification::Event { body: 5 })
407407
.await;
408408
writer
409-
.send_scalar_value::<i32>(DownlinkNotification::Synced)
409+
.send_value::<i32>(DownlinkNotification::Synced)
410410
.await;
411411
writer
412-
.send_scalar_value::<i32>(DownlinkNotification::Unlinked)
412+
.send_value::<i32>(DownlinkNotification::Unlinked)
413413
.await;
414414
writer
415-
.send_scalar_value::<i32>(DownlinkNotification::Linked)
415+
.send_value::<i32>(DownlinkNotification::Linked)
416416
.await;
417417
writer
418-
.send_scalar_value::<i32>(DownlinkNotification::Event { body: 7 })
418+
.send_value::<i32>(DownlinkNotification::Event { body: 7 })
419419
.await;
420420
writer
421-
.send_scalar_value::<i32>(DownlinkNotification::Synced)
421+
.send_value::<i32>(DownlinkNotification::Synced)
422422
.await;
423423
expect_event(&mut event_rx, TestMessage::Linked).await;
424424
expect_event(&mut event_rx, TestMessage::Synced(5)).await;

0 commit comments

Comments
 (0)