Lumiera  0.pre.03
»edit your freedom«
ZoomWindow_test Class Reference

Description

Test:
verify consistent handling of scrolling and zoom settings for the timeline.
  • setting the overall range
  • setting the visible range
  • adjusting the scale factor
  • setting a visible position
  • nudging the position
  • nudging the scale factor
    Remarks
    the safeguard_* tests focus on the boundary cases.
    See also
    zoom-window.hpp

Definition at line 100 of file zoom-window-test.cpp.

Private Member Functions

virtual void run (Arg)
 
void safeguard_extremeOffset ()
 
void safeguard_extremeTimePos ()
 
void safeguard_extremeZoomOut ()
 
void safeguard_poisonousMetric ()
 
void safeguard_reversed_intervals ()
 
void safeguard_toxic_zoomFactor ()
 
void safeguard_veryDeep ()
 
void safeguard_verySmall ()
 
void safeguard_zero_init ()
 
void verify_calibration ()
 
void verify_changeNotification ()
 
void verify_metric ()
 
void verify_scroll ()
 
void verify_setup ()
 
void verify_simpleUsage ()
 
void verify_window ()
 

Member Function Documentation

◆ verify_simpleUsage()

void verify_simpleUsage ( )
inlineprivate
Test:
simple usage example: double the zoom level, then scroll to the left

Definition at line 138 of file zoom-window-test.cpp.

◆ verify_setup()

void verify_setup ( )
inlineprivate
Test:
verify the possible variations for initial setup of the zoom window
  • can be defined either with the canvas duration, or an explicit extension given in pixels, or both
  • after construction, visible window always covers whole canvas
  • window extension, when given, defines the initial metric
  • otherwise pixel extension is derived from default metric

Definition at line 165 of file zoom-window-test.cpp.

◆ verify_calibration()

void verify_calibration ( )
inlineprivate
Test:
verify defining and retaining the effective extension in pixels
  • changes to the extension are applied by adjusting the visible window
  • visible window's start position is maintained
  • unless the resulting window would exceed the overall canvas, in which case the window is shifted, retaining metrics
  • however, if resulting window can not be made to fit, it is truncated to current canvas and metric is adjusted to keep overall pixel extension

Definition at line 202 of file zoom-window-test.cpp.

◆ verify_metric()

void verify_metric ( )
inlineprivate
Test:
zoom in and out, thereby adjusting the metric
  • window extension in pixels is always retained
  • window is shifted when surpassing canvas bounds
  • metric is adjusted to keep excess window within pixel extension
  • otherwise zooming is centred around an anchor position, favouring centre

Definition at line 260 of file zoom-window-test.cpp.

◆ verify_window()

void verify_window ( )
inlineprivate
Test:
position and extension of the visible window can be set explicitly

Definition at line 355 of file zoom-window-test.cpp.

◆ verify_scroll()

void verify_scroll ( )
inlineprivate
Test:
sliding the visible window, possibly expanding canvas

Definition at line 417 of file zoom-window-test.cpp.

◆ verify_changeNotification()

void verify_changeNotification ( )
inlineprivate
Test:
a notification-λ can be attached and will be triggered on each change

Definition at line 458 of file zoom-window-test.cpp.

◆ safeguard_zero_init()

void safeguard_zero_init ( )
inlineprivate
Test:
verify safeguards against empty initialisation interval

Definition at line 535 of file zoom-window-test.cpp.

◆ safeguard_reversed_intervals()

void safeguard_reversed_intervals ( )
inlineprivate
Test:
verify safeguards against reversed time intervals

Definition at line 557 of file zoom-window-test.cpp.

References ZoomWindow::setVisibleDuration().

+ Here is the call graph for this function:

◆ safeguard_toxic_zoomFactor()

void safeguard_toxic_zoomFactor ( )
inlineprivate
Test:
demonstrate sanitising of "poisonous" fractional zoom factor
  • construct an example factor of roughly 2/3, but using extremely large numerator and denominator close to total time axis dimensions.
  • even simple calculations with this poison value will fail
  • construct a new quantiser, based on the number to be sanitised
  • re-quantise the toxic number into this new quantiser
  • the sanitised number is almost identical to the toxic original
  • yet all the simple calculations can be carried out flawlessly
  • both toxic and sanitised number lead to the same zoom timespan

Definition at line 582 of file zoom-window-test.cpp.

◆ safeguard_poisonousMetric()

void safeguard_poisonousMetric ( )
inlineprivate
Test:
verify ZoomWindow code can handle "poisonous" fractional number parameters

Definition at line 625 of file zoom-window-test.cpp.

◆ safeguard_extremeZoomOut()

void safeguard_extremeZoomOut ( )
inlineprivate
Test:
verify ZoomWindow code can handle extreme zoom-out to reveal a timeline of epic dimensions....

Definition at line 718 of file zoom-window-test.cpp.

◆ safeguard_extremeTimePos()

void safeguard_extremeTimePos ( )
inlineprivate
Test:
verify ZoomWindow code can navigate extremal time positions, thereby observing domain bounds without numeric wrap.

Definition at line 828 of file zoom-window-test.cpp.

References Time::MAX, Duration::MAX, and TimeValue::SCALE.

◆ safeguard_extremeOffset()

void safeguard_extremeOffset ( )
inlineprivate
Test:
verify ZoomWindow code is protected against excess scrolling.

Definition at line 910 of file zoom-window-test.cpp.

References Time::MAX, and Duration::MAX.

◆ safeguard_verySmall()

void safeguard_verySmall ( )
inlineprivate
Test:
verify ZoomWindow can handle excessively small windows.

Definition at line 959 of file zoom-window-test.cpp.

References stage::model::anonymous_namespace{zoom-window.hpp}::LIM_HAZARD, Time::MAX, Duration::MAX, and TimeValue::SCALE.

◆ safeguard_veryDeep()

void safeguard_veryDeep ( )
inlineprivate
Test:
verify ZoomWindow and handle extreme zoom-in.
  • scrolling has always an effect
  • visible window is never void

Definition at line 1007 of file zoom-window-test.cpp.

References stage::model::ZOOM_MAX_RESOLUTION.

+ Inheritance diagram for ZoomWindow_test:
+ Collaboration diagram for ZoomWindow_test:

The documentation for this class was generated from the following file: