tangled
alpha
login
or
join now
buttplug.io
/
buttplug
20
fork
atom
Buttplug sex toy control library
20
fork
atom
overview
issues
pulls
pipelines
fix: Fix schema, step count comparisons so tests pass
qdot.tngl.sh
8 months ago
8a615433
c66f5850
+27
-23
3 changed files
expand all
collapse all
unified
split
crates
buttplug_client
src
device
feature.rs
buttplug_core
schema
buttplug-schema.json
buttplug_tests
tests
test_device_protocols.rs
+1
-1
crates/buttplug_client/src/device/feature.rs
···
47
47
}
48
48
49
49
fn check_step_value(&self, feature_output: &DeviceFeatureOutput, steps: u32) -> Result<u32, ButtplugClientError> {
50
50
-
if steps < feature_output.step_count() {
50
50
+
if steps <= feature_output.step_count() {
51
51
Ok(steps)
52
52
} else {
53
53
Err(ButtplugClientError::ButtplugOutputCommandConversionError(format!("{} is larger than the maximum number of steps ({}).", steps, feature_output.step_count())))
+25
-21
crates/buttplug_core/schema/buttplug-schema.json
···
517
517
"Id": { "$ref": "#/components/ServerId" },
518
518
"Devices": {
519
519
"description": "Array of device ids and names.",
520
520
-
"type": "array",
521
521
-
"items": {
522
522
-
"type": "object",
523
523
-
"properties": {
524
524
-
"DeviceName": { "$ref": "#/components/DeviceName" },
525
525
-
"DeviceIndex": { "$ref": "#/components/DeviceIndex" },
526
526
-
"DeviceDisplayName": { "type": "string" },
527
527
-
"DeviceMessageTimingGap": { "type": "integer" },
528
528
-
"DeviceFeatures": {
529
529
-
"type": "array",
530
530
-
"items": {
531
531
-
"$ref": "#/components/DeviceFeatureV4"
520
520
+
"type": "object",
521
521
+
"patternProperties": {
522
522
+
"^[0-9]*": {
523
523
+
"type": "object",
524
524
+
"properties": {
525
525
+
"DeviceName": { "$ref": "#/components/DeviceName" },
526
526
+
"DeviceIndex": { "$ref": "#/components/DeviceIndex" },
527
527
+
"DeviceDisplayName": { "type": "string" },
528
528
+
"DeviceMessageTimingGap": { "type": "integer" },
529
529
+
"DeviceFeatures": {
530
530
+
"type": "object",
531
531
+
"patternProperties": {
532
532
+
"^[0-9]*": {
533
533
+
"$ref": "#/components/DeviceFeatureV4"
534
534
+
}
535
535
+
}
532
536
}
533
533
-
}
534
534
-
},
535
535
-
"additionalProperties": false,
536
536
-
"required": [
537
537
-
"DeviceName",
538
538
-
"DeviceIndex",
539
539
-
"DeviceMessageTimingGap",
540
540
-
"DeviceFeatures"
541
541
-
]
537
537
+
},
538
538
+
"additionalProperties": false,
539
539
+
"required": [
540
540
+
"DeviceName",
541
541
+
"DeviceIndex",
542
542
+
"DeviceMessageTimingGap",
543
543
+
"DeviceFeatures"
544
544
+
]
545
545
+
}
542
546
}
543
547
}
544
548
},
+1
-1
crates/buttplug_tests/tests/test_device_protocols.rs
···
134
134
#[test_case("test_xuanhuan_protocol.yaml" ; "Xuanhuan Protocol")]
135
135
#[tokio::test]
136
136
async fn test_device_protocols_embedded_v4(test_file: &str) {
137
137
-
tracing_subscriber::fmt::init();
137
137
+
//tracing_subscriber::fmt::init();
138
138
util::device_test::client::client_v4::run_embedded_test_case(&load_test_case(test_file).await)
139
139
.await;
140
140
}