diff --git a/tests/Makefile.include b/tests/Makefile.include
index db750dd6d0..76dc581096 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -451,6 +451,20 @@ qapi-schema += returns-whitelist.json
 qapi-schema += struct-base-clash-deep.json
 qapi-schema += struct-base-clash.json
 qapi-schema += struct-data-invalid.json
+qapi-schema += struct-member-alternate-default.json
+qapi-schema += struct-member-bool-wrong-default-type.json
+qapi-schema += struct-member-enum-invalid-default.json
+qapi-schema += struct-member-enum-wrong-default-type.json
+qapi-schema += struct-member-float-invalid-default.json
+qapi-schema += struct-member-float-wrong-default-type.json
+qapi-schema += struct-member-int-wrong-default-type.json
+qapi-schema += struct-member-int8-erange-default.json
+qapi-schema += struct-member-list-nonempty-default.json
+qapi-schema += struct-member-non-optional-default.json
+qapi-schema += struct-member-null-default.json
+qapi-schema += struct-member-str-wrong-default-type.json
+qapi-schema += struct-member-uint8-erange-default.json
+qapi-schema += struct-member-uint8-negative-default.json
 qapi-schema += struct-member-invalid-dict.json
 qapi-schema += struct-member-invalid.json
 qapi-schema += trailing-comma-list.json
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index c6d59acc3e..12ae387d46 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -281,3 +281,31 @@
             'cfs1': 'CondFeatureStruct1',
             'cfs2': 'CondFeatureStruct2',
             'cfs3': 'CondFeatureStruct3' } }
+
+# test defaults for optional struct members
+
+{ 'enum': 'TestDefaultEnum',
+  'data': [ 'value1', 'value2', 'value3' ] }
+
+{ 'struct': 'TestDefaultSubStruct',
+  'data': { 'member': 'int' } }
+
+{ 'struct': 'TestDefaultStruct',
+  'data': {
+      '*bool_false': { 'type': 'bool', 'default': false },
+      '*bool_true':  { 'type': 'bool', 'default': true },
+      '*integer':    { 'type': 'int',   'default': -42 },
+      '*int8_low':   { 'type': 'int8',  'default': -0x80 },
+      '*int8_high':  { 'type': 'int8',  'default':  0x7f },
+      '*uint8_high': { 'type': 'uint8', 'default':  0xff },
+      '*size':       { 'type': 'size',  'default':  0xffffffffffffffff },
+      '*fpneg':    { 'type': 'number', 'default': -.375e3 },
+      '*fppos':    { 'type': 'number', 'default': +42. },
+      '*fpposinf': { 'type': 'number', 'default':  inf },
+      '*fpneginf': { 'type': 'number', 'default': -inf },
+      '*fpnan':    { 'type': 'number', 'default': nan },
+      '*str': { 'type': 'str', 'default': 'foo \\鹿"\u007f\b"\'' },
+      '*enum_value2': { 'type': 'TestDefaultEnum', 'default': 'value2' },
+      '*list_scalar': { 'type': ['int'], 'default': [] },
+      '*list_struct': { 'type': ['TestDefaultSubStruct'], 'default': [] }
+  } }
diff --git a/tests/qapi-schema/struct-member-alternate-default.json b/tests/qapi-schema/struct-member-alternate-default.json
new file mode 100644
index 0000000000..0441b3af80
--- /dev/null
+++ b/tests/qapi-schema/struct-member-alternate-default.json
@@ -0,0 +1,10 @@
+# Check defaults for unsupported types (alternates, here)
+# TODO: Implement support for alternates, and then add a test where
+#       default=null so we can see that that is another thing that
+#       should be implemented
+{ 'enum': 'TestEnum', 'data': [ 'value1', 'value2' ] }
+{ 'alternate': 'TestAlt',
+  'data': { 'alt1': 'TestEnum',
+            'alt2': 'null' } }
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'TestAlt', 'default': 'value1' } } }
diff --git a/tests/qapi-schema/struct-member-bool-wrong-default-type.json b/tests/qapi-schema/struct-member-bool-wrong-default-type.json
new file mode 100644
index 0000000000..c9f9c45a87
--- /dev/null
+++ b/tests/qapi-schema/struct-member-bool-wrong-default-type.json
@@ -0,0 +1,3 @@
+# Check that booleans do not accept non-booleans
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'bool', 'default': 0 } } }
diff --git a/tests/qapi-schema/struct-member-enum-invalid-default.json b/tests/qapi-schema/struct-member-enum-invalid-default.json
new file mode 100644
index 0000000000..d5724970be
--- /dev/null
+++ b/tests/qapi-schema/struct-member-enum-invalid-default.json
@@ -0,0 +1,4 @@
+# Check that enum values do not accept anything that is not part of the enum
+{ 'enum': 'TestEnum', 'data': [ 'value1', 'value2' ] }
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'TestEnum', 'default': 'value3' } } }
diff --git a/tests/qapi-schema/struct-member-enum-wrong-default-type.json b/tests/qapi-schema/struct-member-enum-wrong-default-type.json
new file mode 100644
index 0000000000..98f18b462c
--- /dev/null
+++ b/tests/qapi-schema/struct-member-enum-wrong-default-type.json
@@ -0,0 +1,4 @@
+# Check that enum values do not accept non-strings
+{ 'enum': 'TestEnum', 'data': [ 'value1', 'value2' ] }
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'TestEnum', 'default': 0 } } }
diff --git a/tests/qapi-schema/struct-member-float-invalid-default.json b/tests/qapi-schema/struct-member-float-invalid-default.json
new file mode 100644
index 0000000000..ba351a91c8
--- /dev/null
+++ b/tests/qapi-schema/struct-member-float-invalid-default.json
@@ -0,0 +1,4 @@
+# This matches our number regex, but it is an invalid float still --
+# test that it is rejected
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'number', 'default': 4.42. } } }
diff --git a/tests/qapi-schema/struct-member-float-wrong-default-type.json b/tests/qapi-schema/struct-member-float-wrong-default-type.json
new file mode 100644
index 0000000000..89b6863307
--- /dev/null
+++ b/tests/qapi-schema/struct-member-float-wrong-default-type.json
@@ -0,0 +1,3 @@
+# Check that floats do not accept non-floats
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'number', 'default': 42 } } }
diff --git a/tests/qapi-schema/struct-member-int-wrong-default-type.json b/tests/qapi-schema/struct-member-int-wrong-default-type.json
new file mode 100644
index 0000000000..6c6c752176
--- /dev/null
+++ b/tests/qapi-schema/struct-member-int-wrong-default-type.json
@@ -0,0 +1,3 @@
+# Check that integers do not accept non-integers
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'int', 'default': 0.0 } } }
diff --git a/tests/qapi-schema/struct-member-int8-erange-default.json b/tests/qapi-schema/struct-member-int8-erange-default.json
new file mode 100644
index 0000000000..a0093bc4b9
--- /dev/null
+++ b/tests/qapi-schema/struct-member-int8-erange-default.json
@@ -0,0 +1,3 @@
+# int8 does not accept out-of-range values
+{ 'struct': 'Test',
+  'data': { '*s8': { 'type': 'int8', 'default': -0x81 } } }
diff --git a/tests/qapi-schema/struct-member-list-nonempty-default.json b/tests/qapi-schema/struct-member-list-nonempty-default.json
new file mode 100644
index 0000000000..604692631b
--- /dev/null
+++ b/tests/qapi-schema/struct-member-list-nonempty-default.json
@@ -0,0 +1,4 @@
+# Currently, we do not support nonempty defaults for lists
+# TODO: Implement support
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': ['int'], 'default': [42] } } }
diff --git a/tests/qapi-schema/struct-member-non-optional-default.json b/tests/qapi-schema/struct-member-non-optional-default.json
new file mode 100644
index 0000000000..354b34167d
--- /dev/null
+++ b/tests/qapi-schema/struct-member-non-optional-default.json
@@ -0,0 +1,3 @@
+# Only optional members can have defaults
+{ 'struct': 'Test',
+  'data': { 'member': { 'type': 'int', 'default': 42 } } }
diff --git a/tests/qapi-schema/struct-member-null-default.json b/tests/qapi-schema/struct-member-null-default.json
new file mode 100644
index 0000000000..c0cf70b984
--- /dev/null
+++ b/tests/qapi-schema/struct-member-null-default.json
@@ -0,0 +1,6 @@
+# Currently, you cannot give a default for null members, because
+# 'None' is reserved for 'no default'.
+# TODO: Fix that, though it would only really make sense for
+#       alternates (which currently cannot receive defaults either)
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'null', 'default': null } } }
diff --git a/tests/qapi-schema/struct-member-str-wrong-default-type.json b/tests/qapi-schema/struct-member-str-wrong-default-type.json
new file mode 100644
index 0000000000..d460d3a9b4
--- /dev/null
+++ b/tests/qapi-schema/struct-member-str-wrong-default-type.json
@@ -0,0 +1,3 @@
+# Check that strings do not accept non-strings
+{ 'struct': 'Test',
+  'data': { '*member': { 'type': 'str', 'default': null } } }
diff --git a/tests/qapi-schema/struct-member-uint8-erange-default.json b/tests/qapi-schema/struct-member-uint8-erange-default.json
new file mode 100644
index 0000000000..a4fe7fd918
--- /dev/null
+++ b/tests/qapi-schema/struct-member-uint8-erange-default.json
@@ -0,0 +1,3 @@
+# uint8 does not accept out-of-range values
+{ 'struct': 'Test',
+  'data': { '*u8': { 'type': 'uint8', 'default': 0x100 } } }
diff --git a/tests/qapi-schema/struct-member-uint8-negative-default.json b/tests/qapi-schema/struct-member-uint8-negative-default.json
new file mode 100644
index 0000000000..62bbf86af9
--- /dev/null
+++ b/tests/qapi-schema/struct-member-uint8-negative-default.json
@@ -0,0 +1,3 @@
+# uint8 does not accept negative values
+{ 'struct': 'Test',
+  'data': { '*u8': { 'type': 'uint8', 'default': -1 } } }
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
index 85d510bc00..724276f5de 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -397,3 +397,27 @@ object q_obj_test-features-arg
     member cfs3: CondFeatureStruct3 optional=False
 command test-features q_obj_test-features-arg -> None
    gen=True success_response=True boxed=False oob=False preconfig=False
+enum TestDefaultEnum
+    member value1
+    member value2
+    member value3
+object TestDefaultSubStruct
+    member member: int optional=False
+array TestDefaultSubStructList TestDefaultSubStruct
+object TestDefaultStruct
+    member bool_false: bool optional=True default=False
+    member bool_true: bool optional=True default=True
+    member integer: int optional=True default=-42
+    member int8_low: int8 optional=True default=-128
+    member int8_high: int8 optional=True default=127
+    member uint8_high: uint8 optional=True default=255
+    member size: size optional=True default=18446744073709551615
+    member fpneg: number optional=True default=-375.0
+    member fppos: number optional=True default=42.0
+    member fpposinf: number optional=True default=inf
+    member fpneginf: number optional=True default=-inf
+    member fpnan: number optional=True default=nan
+    member str: str optional=True default=foo \鹿""'
+    member enum_value2: TestDefaultEnum optional=True default=value2
+    member list_scalar: intList optional=True default=[]
+    member list_struct: TestDefaultSubStructList optional=True default=[]
diff --git a/tests/qapi-schema/struct-member-alternate-default.err b/tests/qapi-schema/struct-member-alternate-default.err
new file mode 100644
index 0000000000..48314475f9
--- /dev/null
+++ b/tests/qapi-schema/struct-member-alternate-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-alternate-default.json:9: Cannot specify values for type TestAlt (not built-in or an enum)
diff --git a/tests/qapi-schema/struct-member-alternate-default.exit b/tests/qapi-schema/struct-member-alternate-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-alternate-default.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-alternate-default.out b/tests/qapi-schema/struct-member-alternate-default.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-bool-wrong-default-type.err b/tests/qapi-schema/struct-member-bool-wrong-default-type.err
new file mode 100644
index 0000000000..a0095e5c83
--- /dev/null
+++ b/tests/qapi-schema/struct-member-bool-wrong-default-type.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-bool-wrong-default-type.json:2: Value '0' does not match type bool
diff --git a/tests/qapi-schema/struct-member-bool-wrong-default-type.exit b/tests/qapi-schema/struct-member-bool-wrong-default-type.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-bool-wrong-default-type.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-bool-wrong-default-type.out b/tests/qapi-schema/struct-member-bool-wrong-default-type.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-enum-invalid-default.err b/tests/qapi-schema/struct-member-enum-invalid-default.err
new file mode 100644
index 0000000000..6aa3684a28
--- /dev/null
+++ b/tests/qapi-schema/struct-member-enum-invalid-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-enum-invalid-default.json:3: Value 'value3' does not occur in enum TestEnum
diff --git a/tests/qapi-schema/struct-member-enum-invalid-default.exit b/tests/qapi-schema/struct-member-enum-invalid-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-enum-invalid-default.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-enum-invalid-default.out b/tests/qapi-schema/struct-member-enum-invalid-default.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-enum-wrong-default-type.err b/tests/qapi-schema/struct-member-enum-wrong-default-type.err
new file mode 100644
index 0000000000..846dad0316
--- /dev/null
+++ b/tests/qapi-schema/struct-member-enum-wrong-default-type.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-enum-wrong-default-type.json:3: Enum values must be strings, but '0' is no string
diff --git a/tests/qapi-schema/struct-member-enum-wrong-default-type.exit b/tests/qapi-schema/struct-member-enum-wrong-default-type.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-enum-wrong-default-type.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-enum-wrong-default-type.out b/tests/qapi-schema/struct-member-enum-wrong-default-type.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-float-invalid-default.err b/tests/qapi-schema/struct-member-float-invalid-default.err
new file mode 100644
index 0000000000..1ae241641f
--- /dev/null
+++ b/tests/qapi-schema/struct-member-float-invalid-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-float-invalid-default.json:4:55: "4.42." is not a valid integer or float
diff --git a/tests/qapi-schema/struct-member-float-invalid-default.exit b/tests/qapi-schema/struct-member-float-invalid-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-float-invalid-default.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-float-invalid-default.out b/tests/qapi-schema/struct-member-float-invalid-default.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-float-wrong-default-type.err b/tests/qapi-schema/struct-member-float-wrong-default-type.err
new file mode 100644
index 0000000000..8f8bf68d23
--- /dev/null
+++ b/tests/qapi-schema/struct-member-float-wrong-default-type.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-float-wrong-default-type.json:2: Value '42' does not match type number
diff --git a/tests/qapi-schema/struct-member-float-wrong-default-type.exit b/tests/qapi-schema/struct-member-float-wrong-default-type.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-float-wrong-default-type.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-float-wrong-default-type.out b/tests/qapi-schema/struct-member-float-wrong-default-type.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-int-wrong-default-type.err b/tests/qapi-schema/struct-member-int-wrong-default-type.err
new file mode 100644
index 0000000000..a6b93e8403
--- /dev/null
+++ b/tests/qapi-schema/struct-member-int-wrong-default-type.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-int-wrong-default-type.json:2: Value '0.0' does not match type int
diff --git a/tests/qapi-schema/struct-member-int-wrong-default-type.exit b/tests/qapi-schema/struct-member-int-wrong-default-type.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-int-wrong-default-type.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-int-wrong-default-type.out b/tests/qapi-schema/struct-member-int-wrong-default-type.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-int8-erange-default.err b/tests/qapi-schema/struct-member-int8-erange-default.err
new file mode 100644
index 0000000000..e58bf7279c
--- /dev/null
+++ b/tests/qapi-schema/struct-member-int8-erange-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-int8-erange-default.json:2: Value '-129' does not match type int8
diff --git a/tests/qapi-schema/struct-member-int8-erange-default.exit b/tests/qapi-schema/struct-member-int8-erange-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-int8-erange-default.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-int8-erange-default.out b/tests/qapi-schema/struct-member-int8-erange-default.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-list-nonempty-default.err b/tests/qapi-schema/struct-member-list-nonempty-default.err
new file mode 100644
index 0000000000..48b6fd61a6
--- /dev/null
+++ b/tests/qapi-schema/struct-member-list-nonempty-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-list-nonempty-default.json:3: Support for non-empty lists as default values has not been implemented yet: '[42]'
diff --git a/tests/qapi-schema/struct-member-list-nonempty-default.exit b/tests/qapi-schema/struct-member-list-nonempty-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-list-nonempty-default.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-list-nonempty-default.out b/tests/qapi-schema/struct-member-list-nonempty-default.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-non-optional-default.err b/tests/qapi-schema/struct-member-non-optional-default.err
new file mode 100644
index 0000000000..ba79cb43fa
--- /dev/null
+++ b/tests/qapi-schema/struct-member-non-optional-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-non-optional-default.json:2: 'member' is not optional, so it cannot have a default value
diff --git a/tests/qapi-schema/struct-member-non-optional-default.exit b/tests/qapi-schema/struct-member-non-optional-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-non-optional-default.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-non-optional-default.out b/tests/qapi-schema/struct-member-non-optional-default.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-null-default.err b/tests/qapi-schema/struct-member-null-default.err
new file mode 100644
index 0000000000..6a37655f3d
--- /dev/null
+++ b/tests/qapi-schema/struct-member-null-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-null-default.json:5: Cannot specify values for type null
diff --git a/tests/qapi-schema/struct-member-null-default.exit b/tests/qapi-schema/struct-member-null-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-null-default.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-null-default.out b/tests/qapi-schema/struct-member-null-default.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-str-wrong-default-type.err b/tests/qapi-schema/struct-member-str-wrong-default-type.err
new file mode 100644
index 0000000000..597165e22a
--- /dev/null
+++ b/tests/qapi-schema/struct-member-str-wrong-default-type.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-str-wrong-default-type.json:2: Value 'None' does not match type str
diff --git a/tests/qapi-schema/struct-member-str-wrong-default-type.exit b/tests/qapi-schema/struct-member-str-wrong-default-type.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-str-wrong-default-type.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-str-wrong-default-type.out b/tests/qapi-schema/struct-member-str-wrong-default-type.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-uint8-erange-default.err b/tests/qapi-schema/struct-member-uint8-erange-default.err
new file mode 100644
index 0000000000..a870c7074e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-uint8-erange-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-uint8-erange-default.json:2: Value '256' does not match type uint8
diff --git a/tests/qapi-schema/struct-member-uint8-erange-default.exit b/tests/qapi-schema/struct-member-uint8-erange-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-uint8-erange-default.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/struct-member-uint8-erange-default.out b/tests/qapi-schema/struct-member-uint8-erange-default.out
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/struct-member-uint8-negative-default.err b/tests/qapi-schema/struct-member-uint8-negative-default.err
new file mode 100644
index 0000000000..e17ef38e15
--- /dev/null
+++ b/tests/qapi-schema/struct-member-uint8-negative-default.err
@@ -0,0 +1 @@
+tests/qapi-schema/struct-member-uint8-negative-default.json:2: Value '-1' does not match type uint8
diff --git a/tests/qapi-schema/struct-member-uint8-negative-default.exit b/tests/qapi-schema/struct-member-uint8-negative-default.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/struct-member-uint8-negative-default.exit
@@ -0,0 +1 @@
+1
