]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemumonitorjsontest: Rename 2nd CHECK macro in migration params test
authorJiri Denemark <jdenemar@redhat.com>
Thu, 26 Oct 2017 18:52:32 +0000 (20:52 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 2 Nov 2017 21:14:19 +0000 (22:14 +0100)
The second CHECK macro was used for string parameters. Let's rename it
to CHECK_STR and move it up to have all checks in one place.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
tests/qemumonitorjsontest.c

index 1dcff6672feda1c84cae6b0a856a3054f04adbe4..2cefdcac9cb145320d15a370deea9cb520baae05 100644 (file)
@@ -1830,16 +1830,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
 #define CHECK_INT(VAR, FIELD, VALUE)                                        \
     CHECK_NUM(VAR, FIELD, VALUE, "%d")
 
-    CHECK_INT(compressLevel, "compress-level", 1);
-    CHECK_INT(compressThreads, "compress-threads", 8);
-    CHECK_INT(decompressThreads, "decompress-threads", 2);
-    CHECK_INT(cpuThrottleInitial, "cpu-throttle-initial", 20);
-    CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10);
-
-#undef CHECK_NUM
-#undef CHECK_INT
-
-#define CHECK(VAR, FIELD, VALUE)                                            \
+#define CHECK_STR(VAR, FIELD, VALUE)                                        \
     do {                                                                    \
         if (!params.VAR) {                                                  \
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s is not set", FIELD); \
@@ -1853,10 +1844,17 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
         }                                                                   \
     } while (0)
 
-    CHECK(migrateTLSAlias, "tls-creds", "tls0");
-    CHECK(migrateTLSHostname, "tls-hostname", "");
+    CHECK_INT(compressLevel, "compress-level", 1);
+    CHECK_INT(compressThreads, "compress-threads", 8);
+    CHECK_INT(decompressThreads, "decompress-threads", 2);
+    CHECK_INT(cpuThrottleInitial, "cpu-throttle-initial", 20);
+    CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10);
+    CHECK_STR(migrateTLSAlias, "tls-creds", "tls0");
+    CHECK_STR(migrateTLSHostname, "tls-hostname", "");
 
-#undef CHECK
+#undef CHECK_NUM
+#undef CHECK_INT
+#undef CHECK_STR
 
     ret = 0;