>From 094b2d735e5754f717083dfb032e99e6bd8e423d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 14 Dec 2014 17:18:39 +0100 Subject: [PATCH 1/4] Improve failure reporting in validate_output_xxx tests. Use LMI_ASSERT() in the test code itself instead of inside a helper function to obtain the correct (or at least more useful) information about the error location if the assert is triggered. --- wx_test_validate_output.cpp | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wx_test_validate_output.cpp b/wx_test_validate_output.cpp index 681041e..f288849 100644 --- a/wx_test_validate_output.cpp +++ b/wx_test_validate_output.cpp @@ -58,9 +58,9 @@ class output_file_existence_checker fs::remove(path_); } - void assert_exists() const + bool exists() const { - LMI_ASSERT(fs::exists(path_)); + return fs::exists(path_); } ~output_file_existence_checker() @@ -159,7 +159,7 @@ class output_file_existence_checker ill.close_discard_changes(); // And check that this resulted in the creation of the expected file. - unnamed_trace.assert_exists(); + LMI_ASSERT(unnamed_trace.exists()); // Open an existing illustration already containing the same comment. wxUIActionSimulator ui; @@ -181,7 +181,7 @@ class output_file_existence_checker ui.Char('l', wxMOD_CONTROL); // "File|Close" wxTEST_DIALOG(wxYield(), wxExpectModal(wxNO)); - existing_trace.assert_exists(); + LMI_ASSERT(existing_trace.exists()); } LMI_WX_TEST_CASE(validate_output_mec) @@ -206,7 +206,7 @@ class output_file_existence_checker ui.Char('l', wxMOD_CONTROL); // "File|Close" wxYield(); - unnamed_output.assert_exists(); + LMI_ASSERT(unnamed_output.exists()); // And when opening an existing one. output_file_existence_checker existing_output("MecTesting.mec" + ext); @@ -224,5 +224,5 @@ class output_file_existence_checker ui.Char('l', wxMOD_CONTROL); // "File|Close" wxYield(); - existing_output.assert_exists(); + LMI_ASSERT(existing_output.exists()); } -- 1.7.9