Re: [Cdk-commits] SF.net SVN: cdk:[11649] cdk/branches/rajarshi-descnames/src/test/org/ openscience/cdk/qsar/DescriptorEngineTest.java

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [Cdk-commits] SF.net SVN: cdk:[11649] cdk/branches/rajarshi-descnames/src/test/org/ openscience/cdk/qsar/DescriptorEngineTest.java

by Egon Willighagen-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jul 18, 2008 at 7:37 PM,  <rajarshi@...> wrote:

> Modified: cdk/branches/rajarshi-descnames/src/test/org/openscience/cdk/qsar/DescriptorEngineTest.java
> ===================================================================
> --- cdk/branches/rajarshi-descnames/src/test/org/openscience/cdk/qsar/DescriptorEngineTest.java 2008-07-18 17:34:26 UTC (rev 11648)
> +++ cdk/branches/rajarshi-descnames/src/test/org/openscience/cdk/qsar/DescriptorEngineTest.java 2008-07-18 17:37:35 UTC (rev 11649)
> @@ -48,7 +48,7 @@
>        DescriptorEngine engine = new DescriptorEngine(DescriptorEngine.MOLECULAR);
>         Assert.assertNotNull(engine);
>         int loadedDescriptors = engine.getDescriptorInstances().size();
> -        Assert.assertNotSame(0, loadedDescriptors);
> +        Assert.assertTrue(0 != loadedDescriptors);
>         Assert.assertEquals(loadedDescriptors, engine.getDescriptorClassNames().size());
>         Assert.assertEquals(loadedDescriptors, engine.getDescriptorSpecifications().size());
>     }

I actually tend the use the former version with assertNotSame, because
that gives an error messages like "Found X, but expected 0"... now it
will just say "assertion failed". But, maybe you could add a message
to it:

Assert.assertTrue("Could not load any descriptor.", 0 != loadedDescriptors);

?

Egon


--
----
http://chem-bla-ics.blogspot.com/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel

Re: [Cdk-commits] SF.net SVN: cdk:[11649] cdk/branches/rajarshi-descnames/src/test/org/ openscience/cdk/qsar/DescriptorEngineTest.java

by nightly.py :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Jul 19, 2008, at 1:35 AM, Egon Willighagen wrote:

> On Fri, Jul 18, 2008 at 7:37 PM,  <rajarshi@...>  
> wrote:
>> Modified: cdk/branches/rajarshi-descnames/src/test/org/openscience/
>> cdk/qsar/DescriptorEngineTest.java
>> ===================================================================
>> --- cdk/branches/rajarshi-descnames/src/test/org/openscience/cdk/
>> qsar/DescriptorEngineTest.java 2008-07-18 17:34:26 UTC (rev 11648)
>> +++ cdk/branches/rajarshi-descnames/src/test/org/openscience/cdk/
>> qsar/DescriptorEngineTest.java 2008-07-18 17:37:35 UTC (rev 11649)
>> @@ -48,7 +48,7 @@
>>        DescriptorEngine engine = new DescriptorEngine
>> (DescriptorEngine.MOLECULAR);
>>         Assert.assertNotNull(engine);
>>         int loadedDescriptors = engine.getDescriptorInstances
>> ().size();
>> -        Assert.assertNotSame(0, loadedDescriptors);
>> +        Assert.assertTrue(0 != loadedDescriptors);
>>         Assert.assertEquals(loadedDescriptors,  
>> engine.getDescriptorClassNames().size());
>>         Assert.assertEquals(loadedDescriptors,  
>> engine.getDescriptorSpecifications().size());
>>     }
>
> I actually tend the use the former version with assertNotSame, because
> that gives an error messages like "Found X, but expected 0"...

I've always thought assertNotSame was for checking inequality of  
references, rather than for values. That's why I converted it to a  
boolean test

> now it
> will just say "assertion failed". But, maybe you could add a message
> to it:
>
> Assert.assertTrue("Could not load any descriptor.", 0 !=  
> loadedDescriptors);

Sure

- -------------------------------------------------------------------
Rajarshi Guha  <rguha@...>
GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
- -------------------------------------------------------------------
Mathematics consists of proving the most obvious thing
in the least obvious way.
         -- George Polya


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkiCBcMACgkQZqGSLFHnnoS3/QCdEZy0h4YXHW0mP3awipaJvqkM
rt4An0Xy2CKgHkRsuDHTCT0tp9zN1qbA
=9LtY
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel