Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
[Backend] Fixed bisect logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Helios747 committed Jun 15, 2017
1 parent f2f4585 commit 31ddbf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 4 additions & 4 deletions DolphinBisectTool/Backend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void Bisect(string boot_title = "")
int test_index = 0;
RunBuild run_build = new RunBuild();

while (m_first_index <= m_second_index)
while (!(m_first_index == m_second_index-1))
{

test_index = m_first_index == -1 ? (0 + m_second_index) / 2 : (m_first_index + m_second_index) / 2;
Expand All @@ -55,9 +55,9 @@ public void Bisect(string boot_title = "")
UserInput return_val = BisectEvent(test_index);

if (return_val == UserInput.Yes)
m_second_index = test_index - 1;
m_first_index = test_index;
else if (return_val == UserInput.No)
m_first_index = test_index + 1;
m_second_index = test_index;
else
return;
}
Expand All @@ -66,7 +66,7 @@ public void Bisect(string boot_title = "")

if (open_url == UserInput.Yes)
{
Process.Start("https://dolp.in/" + m_build_list[test_index+1]);
Process.Start("https://dolp.in/" + m_build_list[test_index-1]);
}
}

Expand Down
9 changes: 3 additions & 6 deletions DolphinBisectTool/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private UserInput BisectUserDialog(int build, bool final_trigger)
}
else
{
result = MessageBox.Show("Build " + m_build_list[build] + " may be the cause of your issue. " +
result = MessageBox.Show("Build " + m_build_list[build-1] + " may be the cause of your issue. " +
"Do you want to open the URL for that build?", "Notice",
MessageBoxButtons.YesNo);
start_button.Enabled = true;
Expand Down Expand Up @@ -70,19 +70,16 @@ private void browse_button_Click(object sender, EventArgs e)

private void start_button_Click(object sender, EventArgs e)
{
int first_build;

first_build = first_dev_build.SelectedIndex;

if (second_dev_build.SelectedIndex <= first_build)
if (second_dev_build.SelectedIndex <= first_dev_build.SelectedIndex)
{
MessageBox.Show("Second build cannot be less than or equal to the first.", "Error", MessageBoxButtons.OK);
return;
}

start_button.Enabled = false;

Backend backend = new Backend(first_build, second_dev_build.SelectedIndex, m_build_list);
Backend backend = new Backend(first_dev_build.SelectedIndex, second_dev_build.SelectedIndex, m_build_list);
backend.BisectEvent += BisectUserDialog;
backend.UpdateProgress += ChangeProgressBar;

Expand Down

0 comments on commit 31ddbf7

Please sign in to comment.