[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] wx_test_calculation_summary.cpp
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] wx_test_calculation_summary.cpp |
Date: |
Fri, 6 Mar 2015 20:14:31 +0100 |
On Sun, 25 Jan 2015 01:01:06 +0000 Greg Chicares <address@hidden> wrote:
[Actually, not quite, I surreptitiously updated the quoted text below to
correspond to the later version of the specification, i.e. incorporated
the changes to it from the next day, 2015-01-26]
GC> /// Test calculation summary.
GC> ///
GC> /// Iff the '--distribution' option is specified, then:
GC> /// File | Preferences
GC> /// make sure that "Use built-in calculation summary" is checked, and
GC> /// that the saved selections (those that would become active if the
GC> /// checkbox were unchecked) exactly match the default selections given
GC> /// by default_calculation_summary_columns().
I have a question about default_calculation_summary_columns(): this is a
private function in configurable_settings.cpp which is inaccessible to the
testing code. Does its mention here mean that I have the licence to make it
public and use it? Or should I try, as usual, to make the test work without
any changes to the main program code?
In the latter case, I see two possibilities:
(a) Just duplicate the columns from default_calculation_summary_columns()
in the test code. This is the simplest solution but it has the obvious
shortcoming of duplicating the same data in two places with the usual
risk of the two copies getting out of sync inherent to it.
(b) Use effective_calculation_summary_columns() to access the default
columns via a "backdoor": while this function is not documented to
do it, it currently forwards to default_calculation_summary_columns()
if use_builtin_calculation_summary() is false. I think this is
preferable to (a) but I'm not sure how robust is this and whether
effective_calculation_summary_columns() is guaranteed to continue to
work as it does now in the future.
What would you prefer?
GC> /// File | Preferences
GC> /// uncheck "Use built-in calculation summary"
GC> /// set all "Column" controls to "[none]"
GC> /// do this by simulating {Tab Home} repeatedly because that is
GC> /// much faster and is what a smart user does
In principle, there is no guarantee that doing this would work on all
platforms, e.g. it doesn't work under OS X by default. Of course, lmi
doesn't target that platform currently anyhow, but it still seems a bit
unwise to commit to some particular way of selecting items. The way it's
done currently, i.e. using wxUIActionSimulator::Select(), is safer in the
sense that if this doesn't work for some new platform or a new version of
the existing one, it would be fixed in a newer version of wxWidgets itself
without requiring any changes to lmi code.
Please let me know if this argument seems convincing to you and, if so,
whether I should update the specification to remove the last two lines
(otherwise I'd need to update the code to avoid the use of Select()).
Thanks in advance for your answers to these questions, especially the
first one (as it's the last thing preventing me from submitting a patch
implementing the updated specification)!
VZ
- Re: [lmi] wx_test_calculation_summary.cpp,
Vadim Zeitlin <=