libits-client 3.1.0

library to connect on an ITS MQTT server
Documentation
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
/*
 * Software Name : libits-client
 * SPDX-FileCopyrightText: Copyright (c) Orange SA
 * SPDX-License-Identifier: MIT
 *
 * This software is distributed under the MIT license,
 * see the "LICENSE.txt" file for more details or https://opensource.org/license/MIT/
 *
 * Authors: see CONTRIBUTORS.md
 */

use crate::exchange::etsi::acceleration::{Acceleration, AccelerationMagnitude};
use crate::exchange::etsi::angle::Angle;
use crate::exchange::etsi::collective_perception_message::MapReference;
use crate::exchange::etsi::coordinate::CartesianCoordinate;
use crate::exchange::etsi::longitudinal_lane_position::LongitudinalLanePosition;
use crate::exchange::etsi::object_dimension::ObjectDimension;
use crate::exchange::etsi::shape::Shape;
use crate::exchange::etsi::speed::Speed;
use crate::exchange::etsi::velocity::Velocity;
use serde::{Deserialize, Serialize};

/// Represents a Perceived Object (PO) according to an ETSI standard.
///
/// This message is used to describe information on a unique element around itself.
/// It implements the schema defined in the [CPM version 2.1.0][1].
///
/// [1]: https://github.com/Orange-OpenSource/its-client/blob/master/schema/cpm/cpm_schema_2-1-0.json#L315
#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct PerceivedObject {
    /// Time difference since the last generation of the message.
    pub measurement_delta_time: i16,
    /// Position of the perceived object in 3D Cartesian coordinates with confidence.
    pub position: CartesianPosition3DWithConfidence,

    // optional fields
    /// Unique identifier for the perceived object.
    pub object_id: Option<u16>,
    /// Velocity of the perceived object in 3D with confidence.
    pub velocity: Option<Velocity3dWithConfidence>,
    /// Acceleration of the perceived object in 3D with confidence.
    pub acceleration: Option<Acceleration3dWithConfidence>,
    /// Angles of the perceived object in Euler angle with confidence.
    pub angles: Option<EulerAnglesWithConfidence>,
    /// Angular velocity of the perceived object around the Z-axis with confidence.
    pub z_angular_velocity: Option<CartesianAngularVelocityComponent>,
    /// List of lower triangular positive semidefinite matrices representing correlations.
    #[serde(skip_serializing_if = "Vec::is_empty", default)]
    pub lower_triangular_correlation_matrices: Vec<LowerTriangularPositiveSemidefiniteMatrix>,
    /// Dimensions of the perceived object in 3D with confidence.
    pub object_dimension_z: Option<ObjectDimension>,
    /// Dimensions of the perceived object in 2D with confidence.
    pub object_dimension_y: Option<ObjectDimension>,
    /// Dimensions of the perceived object in 1D with confidence.
    pub object_dimension_x: Option<ObjectDimension>,
    /// Age of the perceived object in milliseconds.
    pub object_age: Option<i16>,
    /// Quality of the object perception, ranging from 0 to 255.
    pub object_perception_quality: Option<u8>,
    /// List of sensor IDs that detected the perceived object.
    #[serde(skip_serializing_if = "Vec::is_empty", default)]
    pub sensor_id_list: Vec<u8>,
    /// List of classifications for the perceived object.
    #[serde(skip_serializing_if = "Vec::is_empty", default)]
    pub classification: Vec<ObjectClassification>,
    /// Position of the perceived object on a map, if available.
    pub map_position: Option<MapPosition>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct MapPosition {
    // optional fields
    /// Reference to the map segment where the perceived object is located.
    pub map_reference: Option<MapReference>,
    /// Identifier for the lane where the perceived object is located.
    pub lane_id: Option<u8>,
    /// Identifier for the connection associated with the perceived object.
    pub connection_id: Option<u8>,
    /// Longitudinal lane position of the perceived object, if available.
    pub longitudinal_lane_position: Option<LongitudinalLanePosition>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct LowerTriangularPositiveSemidefiniteMatrix {
    /// Indicates which components are included in the matrix.
    pub components_included_in_the_matrix: ComponentIncludedInTheMatrix,

    // optional fields
    /// The matrix itself, represented as a vector of vectors of i8.
    #[serde(skip_serializing_if = "Vec::is_empty", default)]
    pub matrix: Vec<Vec<i8>>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct ComponentIncludedInTheMatrix {
    /// Indicates whether the X position is included in the matrix.
    x_position: bool,
    /// Indicates whether the Y position is included in the matrix.
    y_position: bool,
    /// Indicates whether the Z position is included in the matrix.
    z_position: bool,
    /// Indicates whether the X velocity or velocity magnitude is included in the matrix.
    x_velocity_or_velocity_magnitude: bool,
    /// Indicates whether the X velocity or velocity direction is included in the matrix.
    x_velocity_or_velocity_direction: bool,
    /// Indicates whether the Z speed is included in the matrix.
    z_speed: bool,
    /// Indicates whether the X acceleration or acceleration magnitude is included in the matrix.
    x_accel_or_accel_magnitude: bool,
    /// Indicates whether the Y acceleration or acceleration direction is included in the matrix.
    y_accel_or_accel_direction: bool,
    /// Indicates whether the Z acceleration is included in the matrix.
    z_acceleration: bool,
    /// Indicates whether the Z angle is included in the matrix.
    z_angle: bool,
    /// Indicates whether the Y angle is included in the matrix.
    y_angle: bool,
    /// Indicates whether the X angle is included in the matrix.
    x_angle: bool,
    /// Indicates whether the Z angular velocity is included in the matrix.
    z_angular_velocity: bool,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct EulerAnglesWithConfidence {
    /// Z angle in centidegrees with confidence.
    pub z_angle: Angle,

    // optional fields
    /// Y angle in centidegrees with confidence.
    pub y_angle: Option<Angle>,
    /// X angle in centidegrees with confidence.
    pub x_angle: Option<Angle>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct Acceleration3dWithConfidence {
    // optional fields
    /// Polar acceleration of the perceived object with confidence.
    pub polar_acceleration: Option<PolarAcceleration>,
    /// Cartesian acceleration of the perceived object with confidence.
    pub cartesian_acceleration: Option<CartesianAcceleration>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct PolarAcceleration {
    /// Acceleration size of the perceived object.
    pub acceleration_magnitude: AccelerationMagnitude,
    /// Acceleration direction of the perceived object in centidegrees.
    pub acceleration_direction: Angle,

    // optional fields
    /// Z acceleration of the perceived object with confidence.
    pub z_acceleration: Option<Acceleration>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct CartesianAcceleration {
    /// X acceleration of the perceived object with confidence.
    pub x_acceleration: Acceleration,
    /// Y acceleration of the perceived object with confidence.
    pub y_acceleration: Acceleration,

    // optional fields
    /// Z acceleration of the perceived object with confidence.
    pub z_acceleration: Option<Acceleration>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct CartesianAngularVelocityComponent {
    /// Angular velocity value in centidegrees per second.
    pub value: i16,
    /// Confidence level for the angular velocity.
    pub confidence: u8,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct Velocity3dWithConfidence {
    // optional fields
    /// Polar velocity of the perceived object with confidence.
    pub polar_velocity: Option<PolarVelocity>,
    /// Cartesian velocity of the perceived object with confidence.
    pub cartesian_velocity: Option<CartesianVelocity>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct PolarVelocity {
    /// Velocity magnitude of the perceived object.
    pub velocity_magnitude: Speed,
    /// Velocity direction of the perceived object in centidegrees.
    pub velocity_direction: Angle,

    // optional fields
    /// Z velocity of the perceived object with confidence.
    pub z_velocity: Option<Velocity>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct CartesianVelocity {
    /// X velocity of the perceived object with confidence.
    pub x_velocity: Velocity,
    /// Y velocity of the perceived object with confidence.
    pub y_velocity: Velocity,

    // optional fields
    /// Z velocity of the perceived object with confidence.
    pub z_velocity: Option<Velocity>,
}

#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct CartesianPosition3DWithConfidence {
    /// X coordinate of the perceived object in Cartesian coordinates with confidence.
    pub x_coordinate: CartesianCoordinate,
    /// Y coordinate of the perceived object in Cartesian coordinates with confidence.
    pub y_coordinate: CartesianCoordinate,

    // optional fields
    /// Z coordinate of the perceived object in Cartesian coordinates with confidence.
    pub z_coordinate: Option<CartesianCoordinate>,
}

/// Represents the classification of a detected object.
/// This includes the object's class and the confidence level of the classification.
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct ObjectClassification {
    /// Class of the object, such as vehicle, pedestrian, or other types.
    pub object_class: ObjectClass,
    /// Confidence level of the classification ranging from 0 to 255.
    pub confidence: u8,
}

/// Represents the classification of an object.
/// This enum defines various object classes, including vehicles, single vulnerable road users (VRUs),
/// VRU groups, and other types. Each variant may include additional data specific to the class.
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ObjectClass {
    /// Represents a vehicle with an associated identifier.
    Vehicle(u8),
    /// Represents a single vulnerable road user (VRU), such as a pedestrian or bicyclist.
    Vru(Vru),
    /// Represents a group of vulnerable road users (VRUs), including group size and type.
    Group(Group),
    /// Represents an object of another type with an associated identifier.
    Other(u8),
}

/// Represents the classification of a single vulnerable road user (VRU).
/// This enum defines various types of single VRUs, such as pedestrians, bicyclists, motorcyclists, and animals.
/// Each variant includes an associated identifier.
#[serde_with::skip_serializing_none]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Vru {
    /// Represents a pedestrian with an associated identifier.
    Pedestrian(u8),
    /// Represents a bicyclist with an associated identifier.
    BicyclistAndLightVruVehicle(u8),
    /// Represents a motorcyclist with an associated identifier.
    Motorcyclist(u8),
    /// Represents an animal with an associated identifier.
    Animal(u8),
}

/// Represents a group.
/// This struct includes information about the group size, type, and an optional cluster identifier.
#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct Group {
    /// The shape of the bounding box that encloses the cluster.
    pub cluster_bounding_box_shape: Shape,
    /// The size of the cluster, indicating the number in the group.
    pub cluster_cardinality_size: u8,

    // optional fields
    /// An identifier for the cluster.
    pub cluster_id: Option<u8>,
    /// Profiles of the cluster, indicating the presence of different types.
    pub cluster_profiles: Option<ClusterProfiles>,
}

/// Represents the type of group.
/// This struct specifies the presence of different categories within the group.
#[serde_with::skip_serializing_none]
#[derive(Default, Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct ClusterProfiles {
    /// Indicates whether the group contains pedestrians.
    pub pedestrian: bool,
    /// Indicates whether the group contains bicyclists.
    pub bicyclist: bool,
    /// Indicates whether the group contains motorcyclists.
    pub motorcyclist: bool,
    /// Indicates whether the group contains animals.
    pub animal: bool,
}

impl PerceivedObject {
    pub fn is_pedestrian(&self) -> bool {
        self.classification.iter().any(|object_classification| {
            matches!(
                object_classification.object_class,
                ObjectClass::Vru(Vru::Pedestrian(_))
            )
        })
    }

    pub fn is_vehicle(&self) -> bool {
        self.classification.iter().any(|object_classification| {
            matches!(object_classification.object_class, ObjectClass::Vehicle(_))
        })
    }
}

#[cfg(test)]
mod test {
    use crate::exchange::etsi::perceived_object::PerceivedObject;

    fn minimal_po() -> &'static str {
        r#"{
            "measurement_delta_time": 2047,
            "position": {
                "x_coordinate": {
                    "value": 131071,
                    "confidence": 4096
                },
                "y_coordinate": {
                    "value": -131072,
                    "confidence": 1
                }
            }
        }"#
    }

    fn standard_po() -> &'static str {
        r#"{
            "measurement_delta_time": 2047,
            "position": {
                "x_coordinate": {
                    "value": 131071,
                    "confidence": 4096
                },
                "y_coordinate": {
                    "value": -131072,
                    "confidence": 1
                }
            },
            "object_id": 65535,
            "velocity": {
                "cartesian_velocity": {
                    "x_velocity": {
                        "value": 16383,
                        "confidence": 127
                    },
                    "y_velocity": {
                        "value": -16383,
                        "confidence": 1
                    }
                }
            },
            "acceleration": {
                "cartesian_acceleration": {
                    "x_acceleration": {
                        "value": 161,
                        "confidence": 102
                    },
                    "y_acceleration": {
                        "value": -160,
                        "confidence": 0
                    }
                }
            },
            "object_dimension_z": {
                "value": 256,
                "confidence": 32
            },
            "object_dimension_y": {
                "value": 1,
                "confidence": 1
            },
            "object_dimension_x": {
                "value": 128,
                "confidence": 17
            },
            "object_age": 2047,
            "object_perception_quality": 15,
            "classification": [
                {
                    "object_class": {
                        "vehicle": 255
                    },
                    "confidence": 101
                }
            ]
        }"#
    }

    fn full_po() -> &'static str {
        r#"{
            "measurement_delta_time": 2047,
            "position": {
                "x_coordinate": {
                    "value": 131071,
                    "confidence": 4096
                },
                "y_coordinate": {
                    "value": -131072,
                    "confidence": 1
                },
                "z_coordinate": {
                    "value": 0,
                    "confidence": 2048
                }
            },
            "object_id": 65535,
            "velocity": {
                "cartesian_velocity": {
                    "x_velocity": {
                        "value": 16383,
                        "confidence": 127
                    },
                    "y_velocity": {
                        "value": -16383,
                        "confidence": 1
                    },
                    "z_velocity": {
                        "value": 0,
                        "confidence": 64
                    }
                }
            },
            "acceleration": {
                "cartesian_acceleration": {
                    "x_acceleration": {
                        "value": 161,
                        "confidence": 102
                    },
                    "y_acceleration": {
                        "value": -160,
                        "confidence": 0
                    },
                    "z_acceleration": {
                        "value": 0,
                        "confidence": 61
                    }
                }
            },
            "angles": {
                "z_angle": {
                    "value": 3601,
                    "confidence": 127
                },
                "y_angle": {
                    "value": 0,
                    "confidence": 1
                },
                "x_angle": {
                    "value": 1800,
                    "confidence": 64
                }
            },
            "z_angular_velocity": {
                "value": 256,
                "confidence": 7
            },
            "lower_triangular_correlation_matrices": [
                {
                    "components_included_in_the_matrix": {
                        "x_position": true,
                        "y_position": true,
                        "z_position": true,
                        "x_velocity_or_velocity_magnitude": true,
                        "x_velocity_or_velocity_direction": true,
                        "z_speed": true,
                        "x_accel_or_accel_magnitude": true,
                        "y_accel_or_accel_direction": true,
                        "z_acceleration": true,
                        "z_angle": true,
                        "y_angle": true,
                        "x_angle": true,
                        "z_angular_velocity": true
                    },
                    "matrix": [
                        [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                        [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                        [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                        [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                        [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
                        [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
                        [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],
                        [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
                        [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
                        [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
                        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
                        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
                        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
                    ]
                },
                {
                    "components_included_in_the_matrix": {
                        "x_position": false,
                        "y_position": false,
                        "z_position": false,
                        "x_velocity_or_velocity_magnitude": false,
                        "x_velocity_or_velocity_direction": false,
                        "z_speed": false,
                        "x_accel_or_accel_magnitude": false,
                        "y_accel_or_accel_direction": false,
                        "z_acceleration": false,
                        "z_angle": false,
                        "y_angle": false,
                        "x_angle": false,
                        "z_angular_velocity": false
                    },
                    "matrix": [
                        [],
                        [],
                        [],
                        [],
                        [],
                        [],
                        [],
                        [],
                        [],
                        [],
                        [],
                        [],
                        []
                    ]
                }
            ],
            "object_dimension_z": {
                "value": 256,
                "confidence": 32
            },
            "object_dimension_y": {
                "value": 1,
                "confidence": 1
            },
            "object_dimension_x": {
                "value": 128,
                "confidence": 17
            },
            "object_age": 2047,
            "object_perception_quality": 15,
            "sensor_id_list": [1, 2, 3],
            "classification": [
                {
                    "object_class": {
                        "vehicle": 255
                    },
                    "confidence": 101
                },
                {
                    "object_class": {
                        "vru": {
                            "pedestrian": 15
                        }
                    },
                    "confidence": 1
                },
                {
                    "object_class": {
                        "group": {
                            "cluster_bounding_box_shape": {
                                "rectangle": {
                                        "center_point": {
                                            "x_coordinate": 32767,
                                            "y_coordinate": -32768,
                                            "z_coordinate": 0
                                        },
                                        "semi_length": 102,
                                        "semi_breadth": 0,
                                        "orientation": 3601,
                                        "height": 4095
                                    }
                            },
                            "cluster_cardinality_size": 255,
                            "cluster_id": 255,
                            "cluster_profiles": {
                                "pedestrian": true,
                                "bicyclist": true,
                                "motorcyclist": true,
                                "animal": true
                            }
                        }
                    },
                    "confidence": 50
                },
                {
                    "object_class": {
                        "other": 255
                    },
                    "confidence": 25
                }
            ],
            "map_position": {
                "map_reference": {
                    "road_segment": {
                        "id": 65535,
                        "region": 0
                    }
                },
                "lane_id": 255,
                "connection_id": 255,
                "longitudinal_lane_position": {
                    "value": 32767,
                    "confidence": 1023
                }
            }
        }"#
    }

    fn parse_and_verify_po(data: &str, expected_id: Option<u16>) {
        match serde_json::from_str::<PerceivedObject>(data) {
            Ok(po) => {
                assert_eq!(po.object_id, expected_id);
            }
            Err(e) => {
                panic!("Failed to deserialize PO: '{e}'");
            }
        }
    }

    #[test]
    fn test_deserialize_minimal_po() {
        parse_and_verify_po(minimal_po(), None);
    }

    #[test]
    fn test_deserialize_standard_po() {
        parse_and_verify_po(standard_po(), Some(65535));
    }

    #[test]
    fn test_deserialize_full_po() {
        parse_and_verify_po(full_po(), Some(65535));
    }
}