From 7203b7df6ba8d01ec5e5383c312171e3b8d7bdf9 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 24 Sep 2024 15:36:12 +0200 Subject: [PATCH] testutilsqemuschema: Rename and document 'testQEMUSchemaValidateDeprecated' Upcoming patch will add more features we care to check. Rename the function to 'testQEMUSchemaValidateFeatures'. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- tests/testutilsqemuschema.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/testutilsqemuschema.c b/tests/testutilsqemuschema.c index f7b2e122bd..bb3d6b3141 100644 --- a/tests/testutilsqemuschema.c +++ b/tests/testutilsqemuschema.c @@ -29,8 +29,12 @@ struct testQEMUSchemaValidateCtxt { }; +/** + * Validate that the schema member doesn't have some significant features: + * - 'deprecated' - schema member is deprecated + */ static int -testQEMUSchemaValidateDeprecated(virJSONValue *root, +testQEMUSchemaValidateFeatures(virJSONValue *root, const char *name, struct testQEMUSchemaValidateCtxt *ctxt) { @@ -187,8 +191,8 @@ testQEMUSchemaValidateObjectMember(const char *key, return -1; } - /* validate that the member is not deprecated */ - if ((rc = testQEMUSchemaValidateDeprecated(keymember, key, data->ctxt)) < 0) + /* validate that the member doesn't have some of the significant features */ + if ((rc = testQEMUSchemaValidateFeatures(keymember, key, data->ctxt)) < 0) return rc; /* lookup schema entry for keytype */ @@ -387,8 +391,8 @@ testQEMUSchemaValidateEnum(virJSONValue *obj, if (STREQ_NULLABLE(objstr, virJSONValueObjectGetString(member, "name"))) { int rc; - /* the new 'members' array allows us to check deprecations */ - if ((rc = testQEMUSchemaValidateDeprecated(member, objstr, ctxt)) < 0) + /* the new 'members' array allows us to check features */ + if ((rc = testQEMUSchemaValidateFeatures(member, objstr, ctxt)) < 0) return rc; virBufferAsprintf(ctxt->debug, "'%s' OK", NULLSTR(objstr)); @@ -526,7 +530,7 @@ testQEMUSchemaValidateRecurse(virJSONValue *obj, const char *t = virJSONValueObjectGetString(root, "meta-type"); int rc; - if ((rc = testQEMUSchemaValidateDeprecated(root, n, ctxt)) < 0) + if ((rc = testQEMUSchemaValidateFeatures(root, n, ctxt)) < 0) return rc; if (STREQ_NULLABLE(t, "builtin")) { @@ -626,7 +630,7 @@ testQEMUSchemaValidateCommand(const char *command, return -1; } - if ((rc = testQEMUSchemaValidateDeprecated(schemarootcommand, command, &ctxt)) < 0) + if ((rc = testQEMUSchemaValidateFeatures(schemarootcommand, command, &ctxt)) < 0) return rc; if (!arguments)