test: Wrap assert macros in ({ ... }) and fix missing semicolons

Wrap the assert macros in ({ ... }) so they can be safely used both as
right side argument as well as in conditionals without curly brackets
around them. In the process, find a bunch of missing semicolons, fix
them.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
diff --git a/test/cmd/pwm.c b/test/cmd/pwm.c
index 2fc0b5e..cf7ee0e 100644
--- a/test/cmd/pwm.c
+++ b/test/cmd/pwm.c
@@ -27,11 +27,11 @@
 	/* pwm <invert> <pwm_dev_num> <channel> <polarity> */
 	/* cros-ec-pwm doesn't support invert */
 	ut_asserteq(1, run_command("pwm invert 0 0 1", 0));
-	ut_assert_nextline("error(-38)")
+	ut_assert_nextline("error(-38)");
 	ut_assert_console_end();
 
 	ut_asserteq(1, run_command("pwm invert 0 0 0", 0));
-	ut_assert_nextline("error(-38)")
+	ut_assert_nextline("error(-38)");
 	ut_assert_console_end();
 
 	/* pwm <config> <pwm_dev_num> <channel> <period_ns> <duty_ns> */
diff --git a/test/dm/acpigen.c b/test/dm/acpigen.c
index 3ec2743..15b2b6f 100644
--- a/test/dm/acpigen.c
+++ b/test/dm/acpigen.c
@@ -1083,7 +1083,7 @@
 	ut_asserteq(NAME_OP, *ptr++);
 	ptr += 10;
 	ut_asserteq(STRING_PREFIX, *ptr++);
-	ut_asserteq_str("baldrick", (char *)ptr)
+	ut_asserteq_str("baldrick", (char *)ptr);
 	ptr += 9;
 
 	ut_asserteq(NAME_OP, *ptr++);
diff --git a/test/dm/misc.c b/test/dm/misc.c
index 1506fde..8bdd8c6 100644
--- a/test/dm/misc.c
+++ b/test/dm/misc.c
@@ -51,13 +51,13 @@
 	/* Read back last issued ioctl */
 	ut_assertok(misc_call(dev, 2, NULL, 0, &last_ioctl,
 			      sizeof(last_ioctl)));
-	ut_asserteq(6, last_ioctl)
+	ut_asserteq(6, last_ioctl);
 
 	ut_assertok(misc_ioctl(dev, 23, NULL));
 	/* Read back last issued ioctl */
 	ut_assertok(misc_call(dev, 2, NULL, 0, &last_ioctl,
 			      sizeof(last_ioctl)));
-	ut_asserteq(23, last_ioctl)
+	ut_asserteq(23, last_ioctl);
 
 	/* Enable / disable tests */
 
diff --git a/test/dm/phy.c b/test/dm/phy.c
index df4c73f..4d4a083 100644
--- a/test/dm/phy.c
+++ b/test/dm/phy.c
@@ -28,22 +28,22 @@
 	/*
 	 * Get the same phy port in 2 different ways and compare.
 	 */
-	ut_assertok(generic_phy_get_by_name(parent, "phy1", &phy1_method1))
-	ut_assertok(generic_phy_get_by_index(parent, 0, &phy1_method2))
+	ut_assertok(generic_phy_get_by_name(parent, "phy1", &phy1_method1));
+	ut_assertok(generic_phy_get_by_index(parent, 0, &phy1_method2));
 	ut_asserteq(phy1_method1.id, phy1_method2.id);
 
 	/*
 	 * Get the second phy port. Check that the same phy provider (device)
 	 * provides this 2nd phy port, but that the IDs are different
 	 */
-	ut_assertok(generic_phy_get_by_name(parent, "phy2", &phy2))
+	ut_assertok(generic_phy_get_by_name(parent, "phy2", &phy2));
 	ut_asserteq_ptr(phy1_method2.dev, phy2.dev);
 	ut_assert(phy1_method1.id != phy2.id);
 
 	/*
 	 * Get the third phy port. Check that the phy provider is different
 	 */
-	ut_assertok(generic_phy_get_by_name(parent, "phy3", &phy3))
+	ut_assertok(generic_phy_get_by_name(parent, "phy3", &phy3));
 	ut_assert(phy2.dev != phy3.dev);
 
 	/* Try to get a non-existing phy */
diff --git a/test/dm/scmi.c b/test/dm/scmi.c
index 93c7d08..d87e273 100644
--- a/test/dm/scmi.c
+++ b/test/dm/scmi.c
@@ -187,10 +187,10 @@
 	ut_assertnonnull(agent);
 
 	/* Test SCMI resect controller manipulation */
-	ut_assert(!agent->reset[0].asserted)
+	ut_assert(!agent->reset[0].asserted);
 
 	ut_assertok(reset_assert(&scmi_devices->reset[0]));
-	ut_assert(agent->reset[0].asserted)
+	ut_assert(agent->reset[0].asserted);
 
 	ut_assertok(reset_deassert(&scmi_devices->reset[0]));
 	ut_assert(!agent->reset[0].asserted);
diff --git a/test/lib/kconfig.c b/test/lib/kconfig.c
index 472d2c5..76225ba 100644
--- a/test/lib/kconfig.c
+++ b/test/lib/kconfig.c
@@ -15,12 +15,12 @@
 {
 	ulong val;
 
-	ut_asserteq(1, IS_ENABLED(CONFIG_CMDLINE))
-	ut_asserteq(0, IS_ENABLED(CONFIG__UNDEFINED))
+	ut_asserteq(1, IS_ENABLED(CONFIG_CMDLINE));
+	ut_asserteq(0, IS_ENABLED(CONFIG__UNDEFINED));
 
-	ut_asserteq(1, CONFIG_IS_ENABLED(CMDLINE))
-	ut_asserteq(0, CONFIG_IS_ENABLED(OF_PLATDATA))
-	ut_asserteq(0, CONFIG_IS_ENABLED(_UNDEFINED))
+	ut_asserteq(1, CONFIG_IS_ENABLED(CMDLINE));
+	ut_asserteq(0, CONFIG_IS_ENABLED(OF_PLATDATA));
+	ut_asserteq(0, CONFIG_IS_ENABLED(_UNDEFINED));
 
 	ut_asserteq(0xc000,
 		    IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED, CONFIG_BLOBLIST_ADDR));
diff --git a/test/lib/kconfig_spl.c b/test/lib/kconfig_spl.c
index c89ceaec..8f8a341 100644
--- a/test/lib/kconfig_spl.c
+++ b/test/lib/kconfig_spl.c
@@ -15,9 +15,9 @@
 {
 	ulong val;
 
-	ut_asserteq(0, CONFIG_IS_ENABLED(CMDLINE))
-	ut_asserteq(1, CONFIG_IS_ENABLED(OF_PLATDATA))
-	ut_asserteq(0, CONFIG_IS_ENABLED(_UNDEFINED))
+	ut_asserteq(0, CONFIG_IS_ENABLED(CMDLINE));
+	ut_asserteq(1, CONFIG_IS_ENABLED(OF_PLATDATA));
+	ut_asserteq(0, CONFIG_IS_ENABLED(_UNDEFINED));
 
 	/*
 	 * This fails if CONFIG_TEST_KCONFIG_ENABLE is not enabled, since the
diff --git a/test/unicode_ut.c b/test/unicode_ut.c
index 382b796..b27d711 100644
--- a/test/unicode_ut.c
+++ b/test/unicode_ut.c
@@ -192,7 +192,7 @@
 		if (!code)
 			break;
 	}
-	ut_asserteq_ptr(s, d2 + 9)
+	ut_asserteq_ptr(s, d2 + 9);
 
 	/* Check characters less than 0x10000 */
 	s = d3;
@@ -203,7 +203,7 @@
 		if (!code)
 			break;
 	}
-	ut_asserteq_ptr(s, d3 + 9)
+	ut_asserteq_ptr(s, d3 + 9);
 
 	/* Check character greater 0xffff */
 	s = d4;
@@ -228,7 +228,7 @@
 
 	/* Commercial at, translates to one character */
 	pos = buffer;
-	ut_assert(!utf8_put('@', &pos))
+	ut_assert(!utf8_put('@', &pos));
 	ut_asserteq(1, pos - buffer);
 	ut_asserteq('@', buffer[0]);
 	ut_assert(!buffer[1]);