Avoid using print_name when --list-test-cases is used

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh
index 6644b0d..b93d439 100755
--- a/tests/ssl-opt.sh
+++ b/tests/ssl-opt.sh
@@ -879,10 +879,6 @@
     fi
 
     LINE="$LINE$1"
-    if [ "$LIST_TESTS" -gt 0 ]; then
-        printf "%s\n" "$LINE"
-        return
-    fi
 
     printf "%s " "$LINE"
     LEN=$(( 72 - `echo "$LINE" | wc -c` ))
@@ -1601,12 +1597,13 @@
         return
     fi
 
-    print_name "$NAME"
-
     if [ "$LIST_TESTS" -gt 0 ]; then
+        printf "%s\n" "$NAME"
         return
     fi
 
+    print_name "$NAME"
+
     # Do we only run numbered tests?
     if [ -n "$RUN_TEST_NUMBER" ]; then
         case ",$RUN_TEST_NUMBER," in