« Previous | Next » 

Revision b9bdc10e

IDb9bdc10ed3f19a3df80f22f66f006fb2af622250

Added by Iustin Pop over 10 years ago

Add some unittests for node queries

These new tests check that:

- no known fields return unknown
- any unknown field returns unknown
- the type of the fields is consistent between the getters and the
field definition
- the length of each result row corresponds with the number of fields
queried, and the length of the field definitions returned
- the length of the rows corresponds to the number of nodes
- querying fields on empty fields returns all fields

Finally this patch found a bug, in that the pinst_list/sinst_list
fields were declared as QFTNumber (copy-paste error from
pinst_cnt/sinst_cnt), yay!

I also changed genEmptyCluster to ensure that it generates unique node
names, so that the number of result rows is consistent with what we
requested, and switched ResultEntry from a normal constructor to
record syntax, so that we can extract the fields without having to use
pattern matching.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences