Skip to content

Commit 68703d1

Browse files
committed
Update examples since some now work
1 parent 69e1648 commit 68703d1

1 file changed

Lines changed: 36 additions & 26 deletions

File tree

tests/uacpi_examples.rs

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ mod test_infra;
1212
use aml_test_tools::{handlers::null_handler::NullHandler};
1313

1414
#[test]
15-
#[ignore] // Fails with ObjectNotOfExpectedType { expected: Reference, got: Integer }
1615
fn expressions_with_package() {
1716
const ASL: &str = r#"
1817
DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {
@@ -24,7 +23,10 @@ DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {
2423
2524
// ACPICA: AE_SUPPORT, Expressions within package elements are not supported
2625
// Windows, uACPI: Local0 = 50
27-
Local0 = TEST()
26+
Method (MAIN, 0, NotSerialized) {
27+
Local0 = TEST()
28+
Return (Local0 != 50)
29+
}
2830
}
2931
"#;
3032

@@ -87,54 +89,63 @@ DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {
8789
}
8890

8991
#[test]
90-
#[ignore] // ParseFail(ObjectNotOfExpectedType { expected: Reference, got: Integer })
9192
fn multilevel_references() {
9293
const ASL: &str = r#"
9394
DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {
94-
Local0 = 123
95-
Local1 = RefOf(Local0)
96-
Local2 = RefOf(Local1)
95+
Method(MAIN, 0, NotSerialized) {
96+
Local0 = 123
97+
Local1 = RefOf(Local0)
98+
Local2 = RefOf(Local1)
9799
98-
// ACPICA: Local3 = reference->Local0
99-
// Windows, uACPI: Local3 = 123
100-
Local3 = DerefOf(Local2)
100+
// ACPICA: Local3 = reference->Local0
101+
// Windows, uACPI: Local3 = 123
102+
Local3 = DerefOf(Local2)
103+
Return (Local3 != 123)
104+
}
101105
}"#;
102106

103107
let handler = NullHandler;
104108
test_infra::run_aml_test(ASL, handler);
105109
}
106110

107111
#[test]
108-
#[ignore] // "Stores to objects like WrappedObject(UnsafeCell { .. }) are not yet supported"
109112
fn implicit_case_semantics() {
110113
const ASL: &str = r#"
111114
DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {
112-
Name (TEST, "BAR")
115+
Method(MAIN, 0, NotSerialized) {
116+
Name (TEST, "BAR")
117+
118+
// ACPICA: TEST = "00000000004F4F46"
119+
// Windows, uACPI: TEST = "FOO"
120+
TEST = 0x4F4F46
121+
122+
Return (Test != "FOO")
123+
}
113124
114-
// ACPICA: TEST = "00000000004F4F46"
115-
// Windows, uACPI: TEST = "FOO"
116-
TEST = 0x4F4F46
117125
}"#;
118126

119127
let handler = NullHandler;
120128
test_infra::run_aml_test(ASL, handler);
121129
}
122130

123131
#[test]
124-
#[ignore] // "Stores to objects like WrappedObject(UnsafeCell { .. }) are not yet supported"
132+
// TODO: This test isn't quite right as we match on substrings rather than whole strings
125133
fn buffer_size_mutability() {
126134
const ASL: &str = r#"
127135
DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {
128-
Name (TEST, "XXXX")
129-
Name (VAL, "")
130-
131-
// ACPICA: TEST = "LONGSTRING"
132-
// Windows, UACPI: TEST = "LONG"
133-
TEST = "LONGSTRING"
134-
135-
// ACPICA: VAL = "FOO"
136-
// Windows, UACPI: VAL = ""
137-
VAL = "FOO"
136+
Method(MAIN, 0, NotSerialized) {
137+
Name (TEST, "XXXX")
138+
Name (VAL, "")
139+
140+
// ACPICA: TEST = "LONGSTRING"
141+
// Windows, UACPI: TEST = "LONG"
142+
TEST = "LONGSTRING"
143+
144+
// ACPICA: VAL = "FOO"
145+
// Windows, UACPI: VAL = ""
146+
VAL = "FOO"
147+
Return ((TEST != "LONGSTRING") || (VAL != "FOO"))
148+
}
138149
}"#;
139150

140151
let handler = NullHandler;
@@ -170,7 +181,6 @@ DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {
170181
}
171182

172183
#[test]
173-
#[ignore] // CopyObject not yet implemented
174184
fn copy_object_to_self() {
175185
const ASL: &str = r#"
176186
DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {

0 commit comments

Comments
 (0)