You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Trustin Lee <tr...@gmail.com> on 2006/12/12 02:58:45 UTC

Re: svn commit: r485050 - /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/

On 12/10/06, elecharny@apache.org <el...@apache.org> wrote:
>
> Author: elecharny
> Date: Sat Dec  9 11:31:38 2006
> New Revision: 485050
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=485050
> Log:
> Added some SC tests, and fixed a buggy test


<snip/>

Added:
> directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxCheckerTest.java
> URL:
> http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxCheckerTest.java?view=auto&rev=485050
>
> ==============================================================================
> ---
> directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxCheckerTest.java
> (added)
> +++
> directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/Ia5StringSyntaxCheckerTest.java
> Sat Dec  9 11:31:38 2006


<snip/>

+public class Ia5StringSyntaxCheckerTest extends TestCase
> +{


<snip/>

+    public void testWrongCase()
> +    {
> +        assertFalse( checker.isValidSyntax( "Ž" ) );
> +        assertFalse( checker.isValidSyntax( "¤" ) );
> +        assertFalse( checker.isValidSyntax( "" ) );
> +        assertFalse( checker.isValidSyntax( "" ) );
> +        assertFalse( checker.isValidSyntax( "ˆ" ) );
> +        assertFalse( checker.isValidSyntax( "¡" ) );
> +        assertFalse( checker.isValidSyntax( "" ) );
> +        assertFalse( checker.isValidSyntax( "£" ) );
> +        assertFalse( checker.isValidSyntax( "Û" ) );
> +        assertFalse( checker.isValidSyntax( "«" ) );
> +        assertFalse( checker.isValidSyntax( "ã" ) );
> +    }


Characters other than US-ASCII will make the code uncompilable.  The default
system encoding of my Eclipse is UTF-8, so it denies to compile it.  You
could use '\uxxxx' syntax instead to make sure the code is compiled and the
compiled byte code is identical across different systems.
PrintableStringSyntaxCheckTest also has the same problem.  I tried to fix
this problem by replacing these special characters into '\uxxxx' expression,
but I couldn't find any easy way to get the unicode value of each character
and am afraid that I might break the test case.

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: svn commit: r485050 - /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 12/12/06, Trustin Lee <tr...@gmail.com> wrote:
>
> On 12/10/06, elecharny@apache.org <el...@apache.org> wrote:Characters
> other than US-ASCII will make the code uncompilable.  The default system
> encoding of my Eclipse is UTF-8, so it denies to compile it.  You could use
> '\uxxxx' syntax instead to make sure the code is compiled and the compiled
> byte code is identical across different systems.
> PrintableStringSyntaxCheckTest also has the same problem.  I tried to fix
> this problem by replacing these special characters into '\uxxxx' expression,
> but I couldn't find any easy way to get the unicode value of each character
> and am afraid that I might break the test case.
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
>

Grrr... Why does ASCII is still the default encoding ??? Ok, my bad. I have
done that without thinking of consequences... I will fix it right now.

Thanks Trustin !!!

Emmanuel