lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] wx_test_about_version.cpp


From: Greg Chicares
Subject: Re: [lmi] wx_test_about_version.cpp
Date: Sat, 06 Dec 2014 16:07:15 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 2014-12-06 15:04Z, Vadim Zeitlin wrote:
> On Sat, 06 Dec 2014 14:48:48 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> /// Validate version string (timestamp) from "About" dialog title.
[...]
> GC> /// Write the version string to stdout (along with other test output)
> GC> /// for comparison with previously-saved results.
> 
>  I'm not totally sure if this is supposed to be the full dialog title, just
> the last word of it (which is supposed to be the date) or maybe the two
> last words ("version" + date)?

I'd prefer just the last word, e.g. "20141016T2306Z", thus:

-       About dialog title is "About 'Let me illustrate...' version 
20141016T2306Z".
+       About dialog version string is "20141016T2306Z".

> GC> /// Find the last copyright year listed in the dialog's client area,
> GC> /// and compare it to the year in the version string, and also to the
> GC> /// current calendar year: it should match both. [...]
> 
>  I've already implemented this locally, but I'm not totally sure that I did
> this right because there is a balance to be found between checking as much
> as possible and being as forgiving as possible. I.e. I could check that the
> years are actually consecutively increasing numbers. Or, on the contrary, I
> could forget about all the preceding years and just look at the last number
> found in the string. The latter seems a bit dangerous to me, so, finally, I
> implemented a compromise solution which searches for
> 
>       (?:\d{4}, )+(\d{4})
> 
> regex and uses the match as the year. Does this seem correct to you or
> would you prefer something more or less strict?

Nothing more strict is required.

As for the '+' in the regex, at first I thought it wouldn't have done
the right thing in 2008, when this would have been displayed:

    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
    2008 Gregory W. Chicares.

because it looked like there might be a newline before '2008'. But
on closer examination it appears that it's just html wrapping, so
the regex is robust as long as the line you're retrieving is

    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 
2008, 2009, 2010, 2011, 2012, 2013, 2014 Gregory W. Chicares.

> GC> /// Press the pushbutton to read the license, and check that the
> GC> /// license's dialog box is scrollable--to guard against this problem:
> GC> ///   http://lists.nongnu.org/archive/html/lmi/2010-01/msg00001.html
> 
>  This is the really problematic part. We can open the dialog, of course.
> Scrolling it is easy as well if we can only test doing it using the
> keyboard and not the mouse (which would be much trickier). But verifying
> that it actually scrolls is a whole different problem. I have basically no
> idea about how to do it... We could query the window for its scrollbar
> position, but this is not the same as ensuring that it actually scrolled
> its content. Is it worth spending more time on this, with uncertain
> results? Or maybe we could drop this part of the test or, perhaps, just
> limit it to verifying that opening the licence[*] dialog works?

Suppose we just open the dialog and make sure it has a scrollbar.
That's good enough for me. Is it easily feasible?

(I switched resolution to 1920x1200 and maximized the dialog,
or maximised the dialogue if you prefer, and I still couldn't
see half the GPL at a time--so I guess everybody will need a
scrollbar for the next few years at least.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]