From 2e0580078bb86da451cdef79dcdefcfc75151952 Mon Sep 17 00:00:00 2001 From: Toni Helenius Date: Sun, 22 Sep 2024 13:31:39 +0300 Subject: [PATCH] Compare size rather than empty string --- .../com/jme3/shader/GLSLPreprocessorTest.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/jme3-core/src/test/java/com/jme3/shader/GLSLPreprocessorTest.java b/jme3-core/src/test/java/com/jme3/shader/GLSLPreprocessorTest.java index 39ffd3cfa3..3cb739d4ab 100644 --- a/jme3-core/src/test/java/com/jme3/shader/GLSLPreprocessorTest.java +++ b/jme3-core/src/test/java/com/jme3/shader/GLSLPreprocessorTest.java @@ -31,21 +31,17 @@ */ package com.jme3.shader; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - +import com.jme3.asset.AssetInfo; +import com.jme3.asset.AssetKey; +import com.jme3.system.TestUtil; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.InputStreamReader; - -import com.jme3.asset.AssetInfo; -import com.jme3.asset.AssetKey; -import com.jme3.system.TestUtil; - -import org.junit.Test; - import jme3tools.shader.Preprocessor; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import org.junit.Test; public class GLSLPreprocessorTest { @@ -56,7 +52,9 @@ String readAllAsString(InputStream is) throws Exception{ while (true) { String l = reader.readLine(); if (l == null) break; - if (output.toString() != "") output.append("\n"); + if (output.length() > 0) { + output.append("\n"); + } output.append(l); } reader.close();