mirror of
https://github.com/servo/servo.git
synced 2025-06-24 00:54:32 +01:00
Add tests for optional primitive arguments.
This commit is contained in:
parent
d063601ba0
commit
aa9a61a78c
2 changed files with 68 additions and 0 deletions
|
@ -55,6 +55,41 @@ impl TestBinding {
|
||||||
pub fn SetFloatAttributeNullable(&self, _: Option<f32>) {}
|
pub fn SetFloatAttributeNullable(&self, _: Option<f32>) {}
|
||||||
pub fn GetDoubleAttributeNullable(&self) -> Option<f64> { Some(0.) }
|
pub fn GetDoubleAttributeNullable(&self) -> Option<f64> { Some(0.) }
|
||||||
pub fn SetDoubleAttributeNullable(&self, _: Option<f64>) {}
|
pub fn SetDoubleAttributeNullable(&self, _: Option<f64>) {}
|
||||||
|
|
||||||
|
// FIXME (issue #1813) Doesn't currently compile.
|
||||||
|
// pub fn PassOptionalBoolean(&self, _: Option<bool>) {}
|
||||||
|
// pub fn PassOptionalByte(&self, _: Option<i8>) {}
|
||||||
|
// pub fn PassOptionalOctet(&self, _: Option<u8>) {}
|
||||||
|
// pub fn PassOptionalShort(&self, _: Option<i16>) {}
|
||||||
|
// pub fn PassOptionalUnsignedShort(&self, _: Option<u16>) {}
|
||||||
|
// pub fn PassOptionalLong(&self, _: Option<i32>) {}
|
||||||
|
// pub fn PassOptionalUnsignedLong(&self, _: Option<u32>) {}
|
||||||
|
// pub fn PassOptionalLongLong(&self, _: Option<i64>) {}
|
||||||
|
// pub fn PassOptionalUnsignedLongLong(&self, _: Option<u64>) {}
|
||||||
|
// pub fn PassOptionalFloat(&self, _: Option<f32>) {}
|
||||||
|
// pub fn PassOptionalDouble(&self, _: Option<f64>) {}
|
||||||
|
|
||||||
|
pub fn PassOptionalBooleanWithDefault(&self, _: bool) {}
|
||||||
|
pub fn PassOptionalByteWithDefault(&self, _: i8) {}
|
||||||
|
pub fn PassOptionalOctetWithDefault(&self, _: u8) {}
|
||||||
|
pub fn PassOptionalShortWithDefault(&self, _: i16) {}
|
||||||
|
pub fn PassOptionalUnsignedShortWithDefault(&self, _: u16) {}
|
||||||
|
pub fn PassOptionalLongWithDefault(&self, _: i32) {}
|
||||||
|
pub fn PassOptionalUnsignedLongWithDefault(&self, _: u32) {}
|
||||||
|
pub fn PassOptionalLongLongWithDefault(&self, _: i64) {}
|
||||||
|
pub fn PassOptionalUnsignedLongLongWithDefault(&self, _: u64) {}
|
||||||
|
|
||||||
|
pub fn PassOptionalNullableBooleanWithDefault(&self, _: Option<bool>) {}
|
||||||
|
pub fn PassOptionalNullableByteWithDefault(&self, _: Option<i8>) {}
|
||||||
|
pub fn PassOptionalNullableOctetWithDefault(&self, _: Option<u8>) {}
|
||||||
|
pub fn PassOptionalNullableShortWithDefault(&self, _: Option<i16>) {}
|
||||||
|
pub fn PassOptionalNullableUnsignedShortWithDefault(&self, _: Option<u16>) {}
|
||||||
|
pub fn PassOptionalNullableLongWithDefault(&self, _: Option<i32>) {}
|
||||||
|
pub fn PassOptionalNullableUnsignedLongWithDefault(&self, _: Option<u32>) {}
|
||||||
|
pub fn PassOptionalNullableLongLongWithDefault(&self, _: Option<i64>) {}
|
||||||
|
pub fn PassOptionalNullableUnsignedLongLongWithDefault(&self, _: Option<u64>) {}
|
||||||
|
pub fn PassOptionalNullableFloatWithDefault(&self, _: Option<f32>) {}
|
||||||
|
pub fn PassOptionalNullableDoubleWithDefault(&self, _: Option<f64>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Reflectable for TestBinding {
|
impl Reflectable for TestBinding {
|
||||||
|
|
|
@ -26,4 +26,37 @@ interface TestBinding {
|
||||||
attribute unsigned long long? unsignedLongLongAttributeNullable;
|
attribute unsigned long long? unsignedLongLongAttributeNullable;
|
||||||
attribute float? floatAttributeNullable;
|
attribute float? floatAttributeNullable;
|
||||||
attribute double? doubleAttributeNullable;
|
attribute double? doubleAttributeNullable;
|
||||||
|
|
||||||
|
// FIXME (issue #1813) Doesn't currently compile.
|
||||||
|
// void passOptionalBoolean(optional boolean arg);
|
||||||
|
// void passOptionalByte(optional byte arg);
|
||||||
|
// void passOptionalOctet(optional octet arg);
|
||||||
|
// void passOptionalShort(optional short arg);
|
||||||
|
// void passOptionalUnsignedShort(optional unsigned short arg);
|
||||||
|
// void passOptionalLong(optional long arg);
|
||||||
|
// void passOptionalUnsignedLong(optional unsigned long arg);
|
||||||
|
// void passOptionalLongLong(optional long long arg);
|
||||||
|
// void passOptionalUnsignedLongLong(optional unsigned long long arg);
|
||||||
|
// void passOptionalFloat(optional float arg);
|
||||||
|
// void passOptionalDouble(optional double arg);
|
||||||
|
|
||||||
|
void passOptionalBooleanWithDefault(optional boolean arg = false);
|
||||||
|
void passOptionalByteWithDefault(optional byte arg = 0);
|
||||||
|
void passOptionalOctetWithDefault(optional octet arg = 19);
|
||||||
|
void passOptionalShortWithDefault(optional short arg = 5);
|
||||||
|
void passOptionalUnsignedShortWithDefault(optional unsigned short arg = 2);
|
||||||
|
void passOptionalLongWithDefault(optional long arg = 7);
|
||||||
|
void passOptionalUnsignedLongWithDefault(optional unsigned long arg = 6);
|
||||||
|
void passOptionalLongLongWithDefault(optional long long arg = -12);
|
||||||
|
void passOptionalUnsignedLongLongWithDefault(optional unsigned long long arg = 17);
|
||||||
|
|
||||||
|
void passOptionalNullableBooleanWithDefault(optional boolean? arg = null);
|
||||||
|
void passOptionalNullableByteWithDefault(optional byte? arg = null);
|
||||||
|
void passOptionalNullableOctetWithDefault(optional octet? arg = null);
|
||||||
|
void passOptionalNullableShortWithDefault(optional short? arg = null);
|
||||||
|
void passOptionalNullableUnsignedShortWithDefault(optional unsigned short? arg = null);
|
||||||
|
void passOptionalNullableLongWithDefault(optional long? arg = null);
|
||||||
|
void passOptionalNullableUnsignedLongWithDefault(optional unsigned long? arg = null);
|
||||||
|
void passOptionalNullableLongLongWithDefault(optional long long? arg = null);
|
||||||
|
void passOptionalNullableUnsignedLongLongWithDefault(optional unsigned long long? arg = null);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue