Project

General

Profile

« Previous | Next » 

Revision 09784afd

Added by Leszek Koltunski about 3 years ago

Improve the test - now it will hopefully not crash on slow devices.

View differences:

src/main/java/org/distorted/main/RubikDebug.java
28 28

  
29 29
public class RubikDebug
30 30
  {
31
  private static final int CHECK_INTERVAL = 1000;
31
  private static final int LOOP_INTERVAL = 500;
32
  private static final int LOOP_NUM1     = 5;
33
  private static final int LOOP_NUM2     = 9;
32 34

  
33 35
  private String mDebug;
34 36
  private long mResumeTime;
......
66 68

  
67 69
  private void check(int loopNum)
68 70
    {
69
    if( loopNum==1 )
71
    if( loopNum==LOOP_NUM1 )
70 72
      {
71 73
      mChanger.assign();
72 74
      }
73
    if( loopNum==4 )
75
    if( loopNum==LOOP_NUM2 )
74 76
      {
75 77
      if( mNumReturned!=1 )
76 78
        {
......
122 124
      @Override
123 125
      public void run()
124 126
        {
125
        if( mLoopNum==5 )
127
        if( mLoopNum==LOOP_NUM2 )
126 128
          {
127 129
          timer.cancel();
128 130
          }
129 131

  
130 132
        check(mLoopNum++);
131 133
        }
132
      } ,CHECK_INTERVAL, CHECK_INTERVAL);
134
      } ,LOOP_INTERVAL, LOOP_INTERVAL);
133 135
    }
134 136

  
135 137
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff