commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [1/3] [lang] CharUtilsTest#testIsAscii_char loop
Date Sun, 01 Oct 2017 12:33:46 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master 7076b7408 -> d65b9d2be


CharUtilsTest#testIsAscii_char loop

The loop currently loops only up to 128, thus testing just positive
return values of CharUtils#isAscii(char). This patch increase the loop
to go over all the possible values of an unsigned byte, thus testing
also negative return values.


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/ae862ae1
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/ae862ae1
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/ae862ae1

Branch: refs/heads/master
Commit: ae862ae116f2056421ab8d6e997e7b64a95828a5
Parents: c755415
Author: Allon Mureinik <amureini@redhat.com>
Authored: Sat Sep 30 15:27:42 2017 +0300
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Sun Oct 1 14:33:16 2017 +0200

----------------------------------------------------------------------
 src/test/java/org/apache/commons/lang3/CharUtilsTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/ae862ae1/src/test/java/org/apache/commons/lang3/CharUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/CharUtilsTest.java b/src/test/java/org/apache/commons/lang3/CharUtilsTest.java
index 35f7f02..71975d3 100644
--- a/src/test/java/org/apache/commons/lang3/CharUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/CharUtilsTest.java
@@ -219,7 +219,7 @@ public class CharUtilsTest {
         assertTrue(CharUtils.isAscii('\n'));
         assertFalse(CharUtils.isAscii(CHAR_COPY));
 
-        for (int i = 0; i < 128; i++) {
+        for (int i = 0; i < 255; i++) {
             assertEquals(i < 128, CharUtils.isAscii((char) i));
         }
     }


Mime
View raw message