Did you look at that link? That is the class that let's you do
assertions. If you try:

Assert.assertEquals("yes", "no"); // you will get an assertion failed
exception
Assert.assertTrue(1 == 2); // you will get an assertion failed
exception

Assert.assertTrue(1 == 1); // you will not get an exception


On Jan 26, 8:34 pm, EricWang <whaom...@gmail.com> wrote:
> so, you mean Android does not support "assert" currently?
>
> On Jan 27, 11:21 am, Brion Emde <brione2...@gmail.com> wrote:
>
>
>
> > Take a look at theAssertclass, 
> > here:http://developer.android.com/intl/de/reference/junit/framework/Assert...
>
> > On Jan 26, 8:11 pm, EricWang <whaom...@gmail.com> wrote:
>
> > > How can I enableassertstatement on Android?
> > > I have referred to a 
> > > url:http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=d...
> > > and done what it said: adb shell setprop dalvik.vm.enableassertions
> > > all
> > > but nothing happen!
> > > The test code is:
> > >     Log.v("assert1","1");
> > >    assertfalse;
> > >     Log.v("assert2","2");
> > > No matter what I did, "assert2" will be printed, which means "assert
> > > false" does nothing!
> > > What should I do?
> > > BTW, I use eclipse as IDE.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to