Skip to content

Commit

Permalink
Test für schnelles evaluieren
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Murawski committed Dec 24, 2023
1 parent 6ff9390 commit 6610285
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class BasicTest {

@Before
public void init() throws InterruptedException {
GlobalSettingsLoader.testSearchDepth ="22|20|0";
ActivityScenario<DroidZebra> scen = ActivityScenario.launch(DroidZebra.class);
scen.onActivity(z -> zebra = z);
while (zebra == null && !zebra.initialized()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void testCrash2() throws InterruptedException {
//if(i == 30) {
CandidateMove[] candidateMoves = zebra.getGameState().getCandidateMoves();
for(CandidateMove m : candidateMoves) {
assertTrue(m.hasEval);
assertTrue(m.getText() + "ist evaluiert", m.hasEval);
}
//}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import android.content.Context;
import android.content.SharedPreferences;

import com.google.common.base.MoreObjects;
import com.shurik.droidzebra.EngineConfig;

import java.util.Locale;
Expand Down Expand Up @@ -77,11 +79,13 @@ public class GlobalSettingsLoader implements SharedPreferences.OnSharedPreferenc
private OnSettingsChangedListener onSettingsChangedListener;
private int computerMoveDelay = 1000;

public static String testSearchDepth = null;

public GlobalSettingsLoader(Context context) {

this.context = context;

DEFAULT_SETTING_STRENGTH = context.getString(R.string.default_search_depth);
DEFAULT_SETTING_STRENGTH = MoreObjects.firstNonNull(testSearchDepth, context.getString(R.string.default_search_depth));
settingFunction = DEFAULT_SETTING_FUNCTION = Integer.parseInt(context.getString(R.string.default_engine_function));
settingAutoMakeForcedMoves = DEFAULT_SETTING_AUTO_MAKE_FORCED_MOVES = Boolean.parseBoolean(context.getString(R.string.default_auto_make_moves));
settingRandomness = DEFAULT_SETTING_RANDOMNESS = Integer.parseInt(context.getString(R.string.default_randomness));
Expand Down

0 comments on commit 6610285

Please sign in to comment.