tests/qapi-schema: Improve coverage of bogus member docs
New test doc-bad-union-member.json shows we can fail to reject documentation for nonexistent members. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-37-git-send-email-armbru@redhat.com>
This commit is contained in:
		
							parent
							
								
									bdc001caaa
								
							
						
					
					
						commit
						f641d06ad6
					
				| @ -367,8 +367,10 @@ qapi-schema += base-cycle-direct.json | ||||
| qapi-schema += base-cycle-indirect.json | ||||
| qapi-schema += command-int.json | ||||
| qapi-schema += comments.json | ||||
| qapi-schema += doc-bad-alternate-member.json | ||||
| qapi-schema += doc-bad-command-arg.json | ||||
| qapi-schema += doc-bad-symbol.json | ||||
| qapi-schema += doc-bad-union-member.json | ||||
| qapi-schema += doc-before-include.json | ||||
| qapi-schema += doc-before-pragma.json | ||||
| qapi-schema += doc-duplicated-arg.json | ||||
|  | ||||
							
								
								
									
										1
									
								
								tests/qapi-schema/doc-bad-alternate-member.err
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								tests/qapi-schema/doc-bad-alternate-member.err
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| tests/qapi-schema/doc-bad-alternate-member.json:3: The following documented members are not in the declaration: aa, bb | ||||
							
								
								
									
										1
									
								
								tests/qapi-schema/doc-bad-alternate-member.exit
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								tests/qapi-schema/doc-bad-alternate-member.exit
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| 1 | ||||
							
								
								
									
										9
									
								
								tests/qapi-schema/doc-bad-alternate-member.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								tests/qapi-schema/doc-bad-alternate-member.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| # Arguments listed in the doc comment must exist in the actual schema | ||||
| 
 | ||||
| ## | ||||
| # @AorB: | ||||
| # @aa: a | ||||
| # @bb: b | ||||
| ## | ||||
| { 'alternate': 'AorB', | ||||
|   'data': { 'a': 'str', 'b': 'int' } } | ||||
							
								
								
									
										0
									
								
								tests/qapi-schema/doc-bad-alternate-member.out
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								tests/qapi-schema/doc-bad-alternate-member.out
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								tests/qapi-schema/doc-bad-union-member.err
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								tests/qapi-schema/doc-bad-union-member.err
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										1
									
								
								tests/qapi-schema/doc-bad-union-member.exit
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								tests/qapi-schema/doc-bad-union-member.exit
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| 0 | ||||
							
								
								
									
										19
									
								
								tests/qapi-schema/doc-bad-union-member.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								tests/qapi-schema/doc-bad-union-member.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,19 @@ | ||||
| # Arguments listed in the doc comment must exist in the actual schema | ||||
| 
 | ||||
| ## | ||||
| # @Frob: | ||||
| # @a: a | ||||
| # @b: b | ||||
| ## | ||||
| { 'union': 'Frob', | ||||
|   'base': 'Base', | ||||
|   'discriminator': 'type', | ||||
|   'data': { 'nothing': 'Empty' } } | ||||
| 
 | ||||
| { 'struct': 'Base', | ||||
|   'data': { 'type': 'T' } } | ||||
| 
 | ||||
| { 'struct': 'Empty', | ||||
|   'data': { } } | ||||
| 
 | ||||
| { 'enum': 'T', 'data': ['nothing'] } | ||||
							
								
								
									
										11
									
								
								tests/qapi-schema/doc-bad-union-member.out
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								tests/qapi-schema/doc-bad-union-member.out
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| object Base | ||||
|     member type: T optional=False | ||||
| object Empty | ||||
| object Frob | ||||
|     base Base | ||||
|     tag type | ||||
|     case nothing: Empty | ||||
| enum QType ['none', 'qnull', 'qint', 'qstring', 'qdict', 'qlist', 'qfloat', 'qbool'] | ||||
|     prefix QTYPE | ||||
| enum T ['nothing'] | ||||
| object q_empty | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Markus Armbruster
						Markus Armbruster