diff --git a/screenshots/15_palette_icons.png b/screenshots/15_palette_icons.png index feebece..b16d793 100644 Binary files a/screenshots/15_palette_icons.png and b/screenshots/15_palette_icons.png differ diff --git a/screenshots/16_three_windows_icons.png b/screenshots/16_three_windows_icons.png index 9d864aa..194eb54 100644 Binary files a/screenshots/16_three_windows_icons.png and b/screenshots/16_three_windows_icons.png differ diff --git a/tests/chart_pro_render_test.cpp b/tests/chart_pro_render_test.cpp index 9a1bcaa..1d20a8c 100644 --- a/tests/chart_pro_render_test.cpp +++ b/tests/chart_pro_render_test.cpp @@ -113,7 +113,13 @@ int main(int argc, char** argv) { gtk_widget_set_size_request(gtk_widget_get_parent(chart.widget()), 620, 460); gtk_window_resize(GTK_WINDOW(win), 660, 520); - pump(); + // The configure event can arrive after one pump() drains the queue + // (flaky under Xvfb); wait for the allocation to shrink, bounded. + for (int i = 0; i < 40 && + gtk_widget_get_allocated_width(chart.widget()) >= 700; ++i) { + g_usleep(50000); + pump(); + } check(gtk_widget_get_allocated_width(chart.widget()) < 700, "chart widget actually resized"); Counts s = render(chart, 640, 480); diff --git a/tests/code_window_tests.sh b/tests/code_window_tests.sh index 7be08ab..d488c51 100755 --- a/tests/code_window_tests.sh +++ b/tests/code_window_tests.sh @@ -281,17 +281,18 @@ else fail "close-code-window-keeps-app-alive" fi [ -z "$(codewin_id)" ] && pass "code-window-actually-closed" || fail "code-window-actually-closed" -DISPLAY="$XDISP" xdotool windowfocus --sync "$MW" key F10 Right Right Down Return 2>/dev/null +# Reopen from View -> Code View by clicking: F10 menubar activation does +# not fire under bare Xvfb here, and the old fallback coordinates were +# wrong for this menubar (130,12 hits Debug, not View). Measured on this +# display: View spans x 80-128, its submenu opens at x 80, first item +# (Code View) centred near (162, 37) relative to the main window. +DISPLAY="$XDISP" xdotool windowraise "$MW" mousemove --window "$MW" 108 12 click 1 2>/dev/null +sleep 0.7 +DISPLAY="$XDISP" xdotool mousemove --window "$MW" 162 37 click 1 2>/dev/null if wait_win codewin 10; then pass "view-menu-reopens-code-window" else - # Fallback: click the View menu, then its first item. - GEOM=$(DISPLAY="$XDISP" xdotool getwindowgeometry --shell "$MW" 2>/dev/null) - WX=$(echo "$GEOM" | sed -n 's/^X=//p'); WY=$(echo "$GEOM" | sed -n 's/^Y=//p') - DISPLAY="$XDISP" xdotool windowraise "$MW" mousemove --window "$MW" 130 12 click 1 2>/dev/null - sleep 0.7 - DISPLAY="$XDISP" xdotool mousemove --window "$MW" 140 55 click 1 2>/dev/null - if wait_win codewin 10; then pass "view-menu-reopens-code-window (click fallback)"; else fail "view-menu-reopens-code-window"; fi + fail "view-menu-reopens-code-window" fi kill_app diff --git a/tests/palette_icons_tests.sh b/tests/palette_icons_tests.sh index 8a8da73..32e607d 100755 --- a/tests/palette_icons_tests.sh +++ b/tests/palette_icons_tests.sh @@ -101,6 +101,8 @@ if [ -n "$PAL" ] && [ -n "$MAIN" ]; then import -window root -crop 500x220+${CX}+${CY} /tmp/icons_after.png DIFF=$(compare -metric AE -fuzz 5% /tmp/icons_before.png \ /tmp/icons_after.png /tmp/icons_diff.png 2>&1 || true) + # Newer ImageMagick prints "1526 (0.0138727)"; keep the bare count. + DIFF=${DIFF%% *} echo "canvas pixel diff: $DIFF" if [ "${DIFF:-0}" -gt 1000 ] 2>/dev/null; then ok palette-click-places; else bad palette-click-places; fi diff --git a/tests/palette_window_tests.sh b/tests/palette_window_tests.sh index b81e0e9..c61321c 100755 --- a/tests/palette_window_tests.sh +++ b/tests/palette_window_tests.sh @@ -123,6 +123,8 @@ if [ -n "$PAL" ] && [ -n "$MAIN" ]; then import -window root -crop 500x220+${CX}+${CY} /tmp/palette_after.png DIFF=$(compare -metric AE -fuzz 5% /tmp/palette_before.png \ /tmp/palette_after.png /tmp/palette_diff.png 2>&1 || true) + # Newer ImageMagick prints "1526 (0.0138727)"; keep the bare count. + DIFF=${DIFF%% *} echo "canvas pixel diff: $DIFF" if [ "${DIFF:-0}" -gt 1000 ] 2>/dev/null; then ok palette-places-widgets; else bad palette-places-widgets; fi diff --git a/widgets/components/IndVortex/IndVortex.h b/widgets/components/IndVortex/IndVortex.h index d339571..e72e999 100644 --- a/widgets/components/IndVortex/IndVortex.h +++ b/widgets/components/IndVortex/IndVortex.h @@ -207,7 +207,7 @@ inline std::vector adx_v(const OHLCVSeries& s, int p) { } // namespace detail_vortex struct VortexResult { std::vector plus; std::vector minus; }; -VortexResult ind_vortex(const OHLCVSeries& series, int period) { VortexResult r; r.plus.assign(series.size(), detail_vortex::nan_v()); r.minus.assign(series.size(), detail_vortex::nan_v()); if (period < 1) period = 1; std::vector tr = detail_vortex::tr_v(series); for (size_t i = 0; i < series.size(); ++i) { if (i + 1 < (size_t)period || i == 0) continue; double vmp = 0.0, vmm = 0.0, trs = 0.0; for (int j = 0; j < period; ++j) { size_t k = i - (size_t)j; vmp += std::fabs(series[k].high - series[k - 1].low); vmm += std::fabs(series[k].low - series[k - 1].high); trs += tr[k]; } if (trs > 0.0) { r.plus[i] = vmp / trs; r.minus[i] = vmm / trs; } } return r; } +VortexResult ind_vortex(const OHLCVSeries& series, int period) { VortexResult r; r.plus.assign(series.size(), detail_vortex::nan_v()); r.minus.assign(series.size(), detail_vortex::nan_v()); if (period < 1) period = 1; std::vector tr = detail_vortex::tr_v(series); for (size_t i = 0; i < series.size(); ++i) { if (i < (size_t)period) continue; /* need k>=1 so series[k-1] is valid */ double vmp = 0.0, vmm = 0.0, trs = 0.0; for (int j = 0; j < period; ++j) { size_t k = i - (size_t)j; vmp += std::fabs(series[k].high - series[k - 1].low); vmm += std::fabs(series[k].low - series[k - 1].high); trs += tr[k]; } if (trs > 0.0) { r.plus[i] = vmp / trs; r.minus[i] = vmm / trs; } } return r; } class IndVortex { private: Display* display_; int screen_; Window window_; GC gc_; diff --git a/widgets/screenshots/layout.png b/widgets/screenshots/layout.png index fb4e76e..1722ca1 100644 Binary files a/widgets/screenshots/layout.png and b/widgets/screenshots/layout.png differ diff --git a/widgets/screenshots/layout_all.png b/widgets/screenshots/layout_all.png index d38a2d1..2e99c82 100644 Binary files a/widgets/screenshots/layout_all.png and b/widgets/screenshots/layout_all.png differ diff --git a/widgets/screenshots/layout_resize_handles.png b/widgets/screenshots/layout_resize_handles.png index 9a463e9..a0d3278 100644 Binary files a/widgets/screenshots/layout_resize_handles.png and b/widgets/screenshots/layout_resize_handles.png differ diff --git a/widgets/screenshots/palette.png b/widgets/screenshots/palette.png index 012e29b..fb48166 100644 Binary files a/widgets/screenshots/palette.png and b/widgets/screenshots/palette.png differ diff --git a/widgets/test-results/palette_layout_results.csv b/widgets/test-results/palette_layout_results.csv index a881620..cc24e97 100644 --- a/widgets/test-results/palette_layout_results.csv +++ b/widgets/test-results/palette_layout_results.csv @@ -337,7 +337,7 @@ IndVolumePriceTrend,PASS,PASS,6662, IndVolumeRateOfChange,PASS,PASS,13048, IndVolumeWeightedMovingAverage,PASS,PASS,7975, IndVolumeZoneOscillator,PASS,PASS,8774, -IndVortex,PASS,PASS,4300, +IndVortex,PASS,PASS,8632, IndWMA,PASS,PASS,7958, IndWaveTrend,PASS,PASS,4766, IndWeightedClose,PASS,PASS,7627, @@ -535,7 +535,7 @@ TStatusBar,PASS,PASS,46800, TStringGrid,PASS,PASS,16557, TTabControl,PASS,PASS,45098, TTaskDialog,PASS,PASS,46582, -TTimeEdit,PASS,PASS,1050, +TTimeEdit,PASS,PASS,1059, TTimer,PASS,PASS,1194, TToggleBox,PASS,PASS,46783, TToolBar,PASS,PASS,46800,