Gregory Stein Gregory Stein - 1 month ago 10
Android Question

Android Studio: debugging junit test: wrong values are assigned

Good day my fellow developers,

I've written my first unit test in Android Studio. However the behavior is weird or I'm doing something wrong.

In this test I simply create an with X=3 and y=0. But as it turns out from logger, it is always 0. Here is a screenshot. I'm currently on next line from the logging and as you can see in Concole:
INFO: u2: x=0.0 y=0.0

Oh, I'm not allowed to embed images on SO, so please click here.

Anything I'm doing wrong here? Thanks.


You can fix it by setting x, and y after contructor ...

PointF f = new PointF(12f, 15f);
        f.y = 12f;
        f.x = 15f;

enter image description here