Removes newlines of error message strings in metadata unit tests,
libvirt-domain.c and libvirt-network.c
Fixes a minor typo in libvirt-domain.c
Signed-off-by: K Shiva Kiran <shiva_kr(a)riseup.net>
---
include/libvirt/libvirt-domain.h | 2 +-
src/libvirt-domain.c | 3 +--
src/libvirt-network.c | 3 +--
tests/metadatatest.c | 9 +++------
tests/networkmetadatatest.c | 9 +++------
5 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index a1902546bb..ea36805aa3 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -5184,7 +5184,7 @@ typedef void
(*virConnectDomainEventDeviceRemovalFailedCallback)(virConnectPtr c
* virConnectDomainEventMetadataChangeCallback:
* @conn: connection object
* @dom: domain on which the event occurred
- * @type: a value from virDomainMetadataTypea
+ * @type: a value from virDomainMetadataType
* @nsuri: XML namespace URI
* @opaque: application specified data
*
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index ec42bb9a53..80a554a530 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -8585,8 +8585,7 @@ virDomainSetMetadata(virDomainPtr domain,
case VIR_DOMAIN_METADATA_TITLE:
if (metadata && strchr(metadata, '\n')) {
virReportInvalidArg(metadata, "%s",
- _("metadata title can't contain "
- "newlines"));
+ _("metadata title can't contain
newlines"));
goto error;
}
G_GNUC_FALLTHROUGH;
diff --git a/src/libvirt-network.c b/src/libvirt-network.c
index c0daea3a60..ef17a8a04d 100644
--- a/src/libvirt-network.c
+++ b/src/libvirt-network.c
@@ -1974,8 +1974,7 @@ virNetworkSetMetadata(virNetworkPtr network,
case VIR_NETWORK_METADATA_TITLE:
if (metadata && strchr(metadata, '\n')) {
virReportInvalidArg(metadata, "%s",
- _("metadata title can't contain "
- "newlines"));
+ _("metadata title can't contain
newlines"));
goto error;
}
G_GNUC_FALLTHROUGH;
diff --git a/tests/metadatatest.c b/tests/metadatatest.c
index b56428fde5..7136730e6a 100644
--- a/tests/metadatatest.c
+++ b/tests/metadatatest.c
@@ -113,8 +113,7 @@ verifyMetadata(virDomainPtr dom,
if (STRNEQ(metadataAPI, expectAPI)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "XML metadata in API doesn't match expected metadata:
"
- "expected:\n[%s]\ngot:\n[%s]",
+ "XML metadata in API doesn't match expected metadata:
expected:\n[%s]\ngot:\n[%s]",
expectAPI, metadataAPI);
return false;
}
@@ -136,8 +135,7 @@ verifyMetadata(virDomainPtr dom,
if (STRNEQ(metadataXML, expectXML)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "XML in dump doesn't match expected metadata: "
- "expected:\n[%s]\ngot:\n[%s]",
+ "XML in dump doesn't match expected metadata:
expected:\n[%s]\ngot:\n[%s]",
expectXML, metadataXML);
return false;
}
@@ -219,8 +217,7 @@ testTextMetadata(const void *data)
if (STRNEQ_NULLABLE(test->expect, actual)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "expected metadata doesn't match actual: "
- "expected:'%s'\ngot: '%s'",
+ "expected metadata doesn't match actual:
expected:'%s'\ngot: '%s'",
NULLSTR(test->data), NULLSTR(actual));
return -1;
}
diff --git a/tests/networkmetadatatest.c b/tests/networkmetadatatest.c
index c309fb29b0..7a1bca4f73 100644
--- a/tests/networkmetadatatest.c
+++ b/tests/networkmetadatatest.c
@@ -113,8 +113,7 @@ verifyMetadata(virNetworkPtr net,
if (STRNEQ(metadataAPI, expectAPI)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "XML metadata in API doesn't match expected metadata:
"
- "expected:\n[%s]\ngot:\n[%s]",
+ "XML metadata in API doesn't match expected metadata:
expected:\n[%s]\ngot:\n[%s]",
expectAPI, metadataAPI);
return false;
}
@@ -136,8 +135,7 @@ verifyMetadata(virNetworkPtr net,
if (STRNEQ(metadataXML, expectXML)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "XML in dump doesn't match expected metadata: "
- "expected:\n[%s]\ngot:\n[%s]",
+ "XML in dump doesn't match expected metadata:
expected:\n[%s]\ngot:\n[%s]",
expectXML, metadataXML);
return false;
}
@@ -219,8 +217,7 @@ testTextMetadata(const void *data)
if (STRNEQ_NULLABLE(test->expect, actual)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "expected metadata doesn't match actual: "
- "expected:'%s'\ngot: '%s'",
+ "expected metadata doesn't match actual:
expected:'%s'\ngot: '%s'",
NULLSTR(test->data), NULLSTR(actual));
return -1;
}
--
2.42.0