TestNavigator.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. /*
  2. * This source file is part of RmlUi, the HTML/CSS Interface Middleware
  3. *
  4. * For the latest information, see http://github.com/mikke89/RmlUi
  5. *
  6. * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
  7. * Copyright (c) 2019 The RmlUi Team, and contributors
  8. *
  9. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10. * of this software and associated documentation files (the "Software"), to deal
  11. * in the Software without restriction, including without limitation the rights
  12. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. * copies of the Software, and to permit persons to whom the Software is
  14. * furnished to do so, subject to the following conditions:
  15. *
  16. * The above copyright notice and this permission notice shall be included in
  17. * all copies or substantial portions of the Software.
  18. *
  19. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. * THE SOFTWARE.
  26. *
  27. */
  28. #include "TestNavigator.h"
  29. #include "CaptureScreen.h"
  30. #include "TestConfig.h"
  31. #include "TestSuite.h"
  32. #include "TestViewer.h"
  33. #include <RmlUi/Core/Context.h>
  34. #include <RmlUi/Core/Element.h>
  35. #include <RmlUi/Core/Math.h>
  36. #include <Shell.h>
  37. #include <cstdio>
  38. // When capturing frames it seems we need to wait at least an extra frame for the newly submitted
  39. // render to be read back out. If we don't wait, we end up saving a screenshot of the previous test.
  40. constexpr int iteration_wait_frame_count = 2;
  41. TestNavigator::TestNavigator(Rml::RenderInterface* render_interface, Rml::Context* context, TestViewer* viewer, TestSuiteList _test_suites,
  42. int start_suite, int start_case) :
  43. render_interface(render_interface),
  44. context(context), viewer(viewer), test_suites(std::move(_test_suites))
  45. {
  46. RMLUI_ASSERT(context);
  47. RMLUI_ASSERTMSG(!test_suites.empty(), "At least one test suite is required.");
  48. context->GetRootElement()->AddEventListener(Rml::EventId::Keydown, this, true);
  49. context->GetRootElement()->AddEventListener(Rml::EventId::Keydown, this);
  50. context->GetRootElement()->AddEventListener(Rml::EventId::Textinput, this);
  51. context->GetRootElement()->AddEventListener(Rml::EventId::Change, this);
  52. suite_index = Rml::Math::Clamp(start_suite, 0, (int)test_suites.size() - 1);
  53. if (start_case > 0)
  54. CurrentSuite().SetIndex(start_case);
  55. LoadActiveTest();
  56. }
  57. TestNavigator::~TestNavigator()
  58. {
  59. context->GetRootElement()->RemoveEventListener(Rml::EventId::Keydown, this, true);
  60. context->GetRootElement()->RemoveEventListener(Rml::EventId::Keydown, this);
  61. context->GetRootElement()->RemoveEventListener(Rml::EventId::Textinput, this);
  62. context->GetRootElement()->RemoveEventListener(Rml::EventId::Change, this);
  63. ReleaseTextureGeometry(render_interface, reference_geometry);
  64. }
  65. void TestNavigator::Update()
  66. {
  67. if(iteration_state != IterationState::None)
  68. {
  69. RMLUI_ASSERT(iteration_index >= 0);
  70. // Capture test document screenshots iteratively every nth frame.
  71. if (iteration_wait_frames > 0)
  72. {
  73. iteration_wait_frames -= 1;
  74. }
  75. else
  76. {
  77. RMLUI_ASSERT(iteration_index < CurrentSuite().GetNumTests());
  78. iteration_wait_frames = iteration_wait_frame_count;
  79. if (iteration_state == IterationState::Capture)
  80. {
  81. if (!CaptureCurrentView())
  82. {
  83. StopTestSuiteIteration();
  84. return;
  85. }
  86. }
  87. else if (iteration_state == IterationState::Comparison)
  88. {
  89. RMLUI_ASSERT((int)comparison_results.size() == CurrentSuite().GetNumTests());
  90. int test_index = CurrentSuite().GetIndex();
  91. comparison_results[test_index] = CompareCurrentView();
  92. }
  93. iteration_index += 1;
  94. if (CurrentSuite().Next())
  95. LoadActiveTest();
  96. else
  97. StopTestSuiteIteration();
  98. }
  99. }
  100. }
  101. void TestNavigator::Render()
  102. {
  103. if (show_reference && reference_geometry.texture_handle)
  104. {
  105. render_interface->RenderGeometry(reference_geometry.vertices, 4, reference_geometry.indices, 6, reference_geometry.texture_handle,
  106. Rml::Vector2f(0, 0));
  107. }
  108. }
  109. void TestNavigator::ProcessEvent(Rml::Event& event)
  110. {
  111. // Keydown events in capture phase to override text input
  112. if (event == Rml::EventId::Keydown && event.GetPhase() == Rml::EventPhase::Capture)
  113. {
  114. const auto key_identifier = (Rml::Input::KeyIdentifier)event.GetParameter< int >("key_identifier", 0);
  115. const bool key_ctrl = event.GetParameter< bool >("ctrl_key", false);
  116. const bool key_shift = event.GetParameter< bool >("shift_key", false);
  117. Rml::Element* element_filter_input = event.GetCurrentElement()->GetElementById("filterinput");
  118. RMLUI_ASSERT(element_filter_input);
  119. if (key_identifier == Rml::Input::KI_F5)
  120. {
  121. if (key_ctrl && key_shift)
  122. StartTestSuiteIteration(IterationState::Comparison);
  123. else
  124. {
  125. ComparisonResult result = CompareCurrentView();
  126. const Rml::String compare_path = GetCompareInputDirectory() + '/' + GetImageFilenameFromCurrentTest();
  127. if (result.success)
  128. {
  129. if (result.is_equal)
  130. {
  131. Rml::Log::Message(Rml::Log::LT_INFO, "%s compares EQUAL to the reference image %s.",
  132. CurrentSuite().GetFilename().c_str(), compare_path.c_str());
  133. }
  134. else
  135. {
  136. Rml::Log::Message(Rml::Log::LT_INFO, "%s compares NOT EQUAL to the reference image %s.\nSee diff image written to %s.",
  137. CurrentSuite().GetFilename().c_str(), compare_path.c_str(), GetCaptureOutputDirectory().c_str());
  138. }
  139. if (!result.error_msg.empty())
  140. Rml::Log::Message(Rml::Log::LT_ERROR, "%s", result.error_msg.c_str());
  141. }
  142. else
  143. {
  144. Rml::Log::Message(Rml::Log::LT_ERROR, "Comparison of %s failed.\n%s", CurrentSuite().GetFilename().c_str(), result.error_msg.c_str());
  145. }
  146. }
  147. }
  148. else if (key_identifier == Rml::Input::KI_F7)
  149. {
  150. if (key_ctrl && key_shift)
  151. {
  152. StartTestSuiteIteration(IterationState::Capture);
  153. }
  154. else
  155. {
  156. const Rml::String filepath = GetCaptureOutputDirectory() + '/' + GetImageFilenameFromCurrentTest();
  157. if (CaptureCurrentView())
  158. Rml::Log::Message(Rml::Log::LT_INFO, "Succesfully captured and saved screenshot to %s", filepath.c_str());
  159. else
  160. Rml::Log::Message(Rml::Log::LT_ERROR, "Could not capture screenshot to %s", filepath.c_str());
  161. }
  162. }
  163. else if (key_identifier == Rml::Input::KI_F1)
  164. {
  165. viewer->ShowHelp(!viewer->IsHelpVisible());
  166. }
  167. else if (key_identifier == Rml::Input::KI_F && key_ctrl)
  168. {
  169. element_filter_input->Focus();
  170. context->ProcessKeyDown(Rml::Input::KI_A, Rml::Input::KeyModifier::KM_CTRL);
  171. context->ProcessKeyUp(Rml::Input::KI_A, Rml::Input::KeyModifier::KM_CTRL);
  172. }
  173. else if (key_identifier == Rml::Input::KI_R && key_ctrl)
  174. {
  175. LoadActiveTest();
  176. }
  177. else if (key_identifier == Rml::Input::KI_S && key_ctrl)
  178. {
  179. if (source_state == SourceType::None)
  180. {
  181. source_state = (key_shift ? SourceType::Reference : SourceType::Test);
  182. }
  183. else
  184. {
  185. if (key_shift)
  186. source_state = (source_state == SourceType::Reference ? SourceType::Test : SourceType::Reference);
  187. else
  188. source_state = SourceType::None;
  189. }
  190. viewer->ShowSource(source_state);
  191. ShowReference(false, false);
  192. }
  193. else if (key_identifier == Rml::Input::KI_Q && key_ctrl)
  194. {
  195. ShowReference(!show_reference, false);
  196. }
  197. else if (key_identifier == Rml::Input::KI_ESCAPE)
  198. {
  199. if (iteration_state != IterationState::None)
  200. {
  201. StopTestSuiteIteration();
  202. }
  203. else if (viewer->IsHelpVisible())
  204. {
  205. viewer->ShowHelp(false);
  206. }
  207. else if (source_state != SourceType::None)
  208. {
  209. source_state = SourceType::None;
  210. viewer->ShowSource(source_state);
  211. }
  212. else if (element_filter_input->IsPseudoClassSet("focus"))
  213. {
  214. element_filter_input->Blur();
  215. }
  216. else if (goto_index >= 0)
  217. {
  218. goto_index = -1;
  219. UpdateGoToText();
  220. }
  221. }
  222. else if (key_identifier == Rml::Input::KI_RETURN || key_identifier == Rml::Input::KI_NUMPADENTER)
  223. {
  224. element_filter_input->Blur();
  225. }
  226. else if (key_identifier == Rml::Input::KI_G && key_ctrl)
  227. {
  228. if (goto_index < 0)
  229. {
  230. goto_index = 0;
  231. UpdateGoToText();
  232. element_filter_input->Blur();
  233. }
  234. }
  235. }
  236. // Keydown events in target/bubble phase ignored when focusing on input.
  237. if (event == Rml::EventId::Keydown && event.GetPhase() != Rml::EventPhase::Capture)
  238. {
  239. const auto key_identifier = (Rml::Input::KeyIdentifier)event.GetParameter< int >("key_identifier", 0);
  240. if (key_identifier == Rml::Input::KI_LEFT)
  241. {
  242. if (CurrentSuite().Previous())
  243. {
  244. LoadActiveTest();
  245. }
  246. }
  247. else if (key_identifier == Rml::Input::KI_RIGHT)
  248. {
  249. if (CurrentSuite().Next())
  250. {
  251. LoadActiveTest();
  252. }
  253. }
  254. else if (key_identifier == Rml::Input::KI_UP)
  255. {
  256. const Rml::String& filter = CurrentSuite().GetFilter();
  257. int new_index = std::max(0, suite_index - 1);
  258. if (new_index != suite_index)
  259. {
  260. suite_index = new_index;
  261. CurrentSuite().SetFilter(filter);
  262. LoadActiveTest();
  263. }
  264. }
  265. else if (key_identifier == Rml::Input::KI_DOWN)
  266. {
  267. const Rml::String& filter = CurrentSuite().GetFilter();
  268. int new_index = std::min((int)test_suites.size() - 1, suite_index + 1);
  269. if (new_index != suite_index)
  270. {
  271. suite_index = new_index;
  272. CurrentSuite().SetFilter(filter);
  273. LoadActiveTest();
  274. }
  275. }
  276. else if (key_identifier == Rml::Input::KI_HOME)
  277. {
  278. CurrentSuite().SetIndex(0, TestSuite::Direction::Forward);
  279. LoadActiveTest();
  280. }
  281. else if (key_identifier == Rml::Input::KI_END)
  282. {
  283. CurrentSuite().SetIndex(CurrentSuite().GetNumTests() - 1, TestSuite::Direction::Backward);
  284. LoadActiveTest();
  285. }
  286. else if (goto_index >= 0 && key_identifier == Rml::Input::KI_BACK)
  287. {
  288. if (goto_index <= 0)
  289. goto_index = -1;
  290. else
  291. goto_index = goto_index / 10;
  292. UpdateGoToText();
  293. }
  294. }
  295. if (event == Rml::EventId::Textinput && goto_index >= 0)
  296. {
  297. const Rml::String text = event.GetParameter< Rml::String >("text", "");
  298. for (const char c : text)
  299. {
  300. if (c >= '0' && c <= '9')
  301. {
  302. goto_index = goto_index * 10 + int(c - '0');
  303. UpdateGoToText();
  304. }
  305. else if (goto_index >= 0 && c == '\n')
  306. {
  307. bool out_of_bounds = false;
  308. if (goto_index > 0)
  309. {
  310. if (CurrentSuite().SetIndex(goto_index - 1))
  311. LoadActiveTest();
  312. else
  313. out_of_bounds = true;
  314. }
  315. goto_index = -1;
  316. UpdateGoToText(out_of_bounds);
  317. }
  318. }
  319. }
  320. if (event == Rml::EventId::Change)
  321. {
  322. Rml::Element* element = event.GetTargetElement();
  323. if (element->GetId() == "filterinput")
  324. {
  325. CurrentSuite().SetFilter(event.GetParameter< Rml::String >("value", ""));
  326. LoadActiveTest();
  327. }
  328. }
  329. }
  330. void TestNavigator::LoadActiveTest()
  331. {
  332. const TestSuite& suite = CurrentSuite();
  333. viewer->LoadTest(suite.GetDirectory(), suite.GetFilename(), suite.GetIndex(), suite.GetNumTests(), suite.GetFilterIndex(), suite.GetNumFilteredTests(), suite_index, (int)test_suites.size());
  334. viewer->ShowSource(source_state);
  335. ShowReference(false, true);
  336. UpdateGoToText();
  337. }
  338. Rml::String TestNavigator::GetImageFilenameFromCurrentTest()
  339. {
  340. const Rml::String& filename = CurrentSuite().GetFilename();
  341. return filename.substr(0, filename.rfind('.')) + ".png";
  342. }
  343. ComparisonResult TestNavigator::CompareCurrentView()
  344. {
  345. const Rml::String filename = GetImageFilenameFromCurrentTest();
  346. ComparisonResult result = CompareScreenToPreviousCapture(render_interface, filename, nullptr);
  347. return result;
  348. }
  349. bool TestNavigator::CaptureCurrentView()
  350. {
  351. const Rml::String filename = GetImageFilenameFromCurrentTest();
  352. bool result = CaptureScreenshot(filename, 1060);
  353. return result;
  354. }
  355. void TestNavigator::StartTestSuiteIteration(IterationState new_iteration_state)
  356. {
  357. if (iteration_state != IterationState::None || new_iteration_state == IterationState::None)
  358. return;
  359. source_state = SourceType::None;
  360. TestSuite& suite = CurrentSuite();
  361. if (new_iteration_state == IterationState::Comparison)
  362. {
  363. comparison_results.clear();
  364. comparison_results.resize(suite.GetNumTests());
  365. }
  366. iteration_initial_index = suite.GetIndex();
  367. iteration_wait_frames = iteration_wait_frame_count;
  368. iteration_state = new_iteration_state;
  369. iteration_index = 0;
  370. suite.SetIndex(iteration_index, TestSuite::Direction::Forward);
  371. LoadActiveTest();
  372. }
  373. static bool SaveFile(const Rml::String& file_path, const Rml::String& contents)
  374. {
  375. std::FILE* file = std::fopen(file_path.c_str(), "wt");
  376. if (!file)
  377. return false;
  378. std::fputs(contents.c_str(), file);
  379. std::fclose(file);
  380. return true;
  381. }
  382. void TestNavigator::StopTestSuiteIteration()
  383. {
  384. if (iteration_state == IterationState::None)
  385. return;
  386. const Rml::String output_directory = GetCaptureOutputDirectory();
  387. TestSuite& suite = CurrentSuite();
  388. const int num_tests = suite.GetNumTests();
  389. const int num_filtered_tests = suite.GetNumFilteredTests();
  390. if (iteration_state == IterationState::Capture)
  391. {
  392. if (iteration_index == num_tests)
  393. {
  394. Rml::Log::Message(Rml::Log::LT_INFO, "Successfully captured %d document screenshots to directory: %s", iteration_index, output_directory.c_str());
  395. }
  396. else if (iteration_index == num_filtered_tests)
  397. {
  398. Rml::Log::Message(Rml::Log::LT_INFO, "Successfully captured %d document screenshots (filtered out of %d total tests) to directory: %s", iteration_index, num_tests, output_directory.c_str());
  399. }
  400. else
  401. {
  402. Rml::Log::Message(Rml::Log::LT_ERROR, "Test suite capture aborted after %d of %d test(s). Output directory: %s", iteration_index, num_tests, output_directory.c_str());
  403. }
  404. }
  405. else if (iteration_state == IterationState::Comparison)
  406. {
  407. RMLUI_ASSERT(num_tests == (int)comparison_results.size());
  408. // Indices
  409. Rml::Vector<int> equal;
  410. Rml::Vector<int> not_equal;
  411. Rml::Vector<int> failed;
  412. Rml::Vector<int> skipped;
  413. for(int i = 0; i < (int)comparison_results.size(); i++)
  414. {
  415. const ComparisonResult& comparison = comparison_results[i];
  416. if (comparison.skipped)
  417. skipped.push_back(i);
  418. else if (!comparison.success)
  419. failed.push_back(i);
  420. else if (comparison.is_equal)
  421. equal.push_back(i);
  422. else
  423. not_equal.push_back(i);
  424. }
  425. Rml::String summary = Rml::CreateString(256, " Total tests: %d\n Equal: %d\n Not equal: %d\n Failed: %d\n Skipped: %d",
  426. num_tests, (int)equal.size(), (int)not_equal.size(), (int)failed.size(), (int)skipped.size());
  427. if (!suite.GetFilter().empty())
  428. summary += "\n Filter applied: " + suite.GetFilter();
  429. if (iteration_index == num_tests)
  430. {
  431. Rml::Log::Message(Rml::Log::LT_INFO, "Compared all test documents to their screenshot captures.\n%s", summary.c_str());
  432. }
  433. else if (iteration_index == num_filtered_tests)
  434. {
  435. Rml::Log::Message(Rml::Log::LT_INFO, "Compared all filtered test documents to their screenshot captures.\n%s", summary.c_str());
  436. }
  437. else
  438. {
  439. Rml::Log::Message(Rml::Log::LT_ERROR, "Test suite comparison aborted after %d of %d test(s).\n%s", iteration_index, num_tests, summary.c_str());
  440. }
  441. Rml::String log;
  442. log.reserve(comparison_results.size() * 100);
  443. log += "RmlUi VisualTests comparison log output\n---------------------------------------\n\n" + summary;
  444. log += "\n\nNot Equal:\n";
  445. if (!not_equal.empty())
  446. log += "Percentages are similarity scores. Difference images written to " + GetCaptureOutputDirectory() + "/*-diff.png\n\n";
  447. for (int i : not_equal)
  448. {
  449. suite.SetIndex(i);
  450. log += Rml::CreateString(256, "%5d %5.1f%% %s\n", i + 1, comparison_results[i].similarity_score*100.0, suite.GetFilename().c_str());
  451. if (!comparison_results[i].error_msg.empty())
  452. log += " " + comparison_results[i].error_msg + "\n";
  453. }
  454. log += "\nEqual:\n";
  455. for (int i : equal)
  456. {
  457. suite.SetIndex(i);
  458. log += Rml::CreateString(256, "%5d %s\n", i + 1, suite.GetFilename().c_str());
  459. }
  460. log += "\nFailed:\n";
  461. for (int i : failed)
  462. {
  463. suite.SetIndex(i);
  464. log += Rml::CreateString(512, "%5d %s\n", i + 1, suite.GetFilename().c_str());
  465. log += " " + comparison_results[i].error_msg + "\n";
  466. }
  467. log += "\nSkipped:\n";
  468. for (int i : skipped)
  469. {
  470. suite.SetIndex(i);
  471. log += Rml::CreateString(256, "%5d %s\n", i + 1, suite.GetFilename().c_str());
  472. }
  473. const Rml::String log_path = GetCaptureOutputDirectory() + "/comparison.log";
  474. bool save_result = SaveFile(log_path, log);
  475. if (save_result && failed.empty())
  476. Rml::Log::Message(Rml::Log::LT_INFO, "Comparison log output written to %s", log_path.c_str());
  477. else if(save_result && !failed.empty())
  478. Rml::Log::Message(Rml::Log::LT_ERROR, "Comparison log output written to %s.\nSome comparisons failed, see log output for details.", log_path.c_str());
  479. else
  480. Rml::Log::Message(Rml::Log::LT_ERROR, "Failed writing comparison log output to file %s", log_path.c_str());
  481. }
  482. iteration_index = -1;
  483. iteration_initial_index = -1;
  484. iteration_wait_frames = -1;
  485. iteration_state = IterationState::None;
  486. suite.SetIndex(iteration_initial_index);
  487. LoadActiveTest();
  488. }
  489. void TestNavigator::UpdateGoToText(bool out_of_bounds)
  490. {
  491. if (out_of_bounds)
  492. viewer->SetGoToText("Go To out of bounds");
  493. else if (goto_index > 0)
  494. viewer->SetGoToText(Rml::CreateString(64, "Go To: %d", goto_index));
  495. else if (goto_index == 0)
  496. viewer->SetGoToText("Go To:");
  497. else if (iteration_state == IterationState::Capture)
  498. viewer->SetGoToText("Capturing all tests");
  499. else if (iteration_state == IterationState::Comparison)
  500. viewer->SetGoToText("Comparing all tests");
  501. else if (show_reference)
  502. viewer->SetGoToText(Rml::CreateString(100, "Showing reference capture (%.1f%% similar)", reference_comparison.similarity_score * 100.));
  503. else
  504. viewer->SetGoToText("Press 'F1' for keyboard shortcuts.");
  505. }
  506. void TestNavigator::ShowReference(bool show, bool clear)
  507. {
  508. if (clear)
  509. {
  510. ReleaseTextureGeometry(render_interface, reference_geometry);
  511. reference_comparison = {};
  512. }
  513. Rml::String error_msg;
  514. if (show && !reference_geometry.texture_handle)
  515. {
  516. reference_comparison = CompareScreenToPreviousCapture(render_interface, GetImageFilenameFromCurrentTest(), &reference_geometry);
  517. if (!reference_comparison.success)
  518. error_msg = reference_comparison.error_msg;
  519. }
  520. show_reference = (show && reference_comparison.success && !reference_comparison.is_equal);
  521. viewer->SetAttention(show_reference);
  522. if (!error_msg.empty())
  523. viewer->SetGoToText(error_msg);
  524. else if (reference_comparison.is_equal)
  525. viewer->SetGoToText("EQUAL to reference capture");
  526. else
  527. UpdateGoToText();
  528. }