[PATCH v2] winetest: Add GUI to display results of individual tests.

Zebediah Figura z.figura12 at gmail.com
Thu Jan 31 21:00:31 CST 2019


On 1/30/19 9:03 AM, Isira Seneviratne wrote:
> From 81fcdd3ad885026c302105e5fb9fef6c53b59bd5 Mon Sep 17 00:00:00 2001
> From: Isira-Seneviratne <isirasen96 at gmail.com>
> Date: Sun, 16 Dec 2018 14:59:20 +0530
> Subject: [PATCH v2] winetest: Add GUI to display results of individual tests.
> 
> This patch adds a listview control displaying the results of each
> test, together with the component being tested.
> 
> Signed-off-by: Isira-Seneviratne <isirasen96 at gmail.com>
> ---
>  programs/winetest/gui.c       | 25 +++++++++++++--
>  programs/winetest/main.c      | 58 +++++++++++++++++++++++++++++++++--
>  programs/winetest/resource.h  |  2 ++
>  programs/winetest/winetest.h  |  4 +++
>  programs/winetest/winetest.rc | 20 +++++++-----
>  5 files changed, 97 insertions(+), 12 deletions(-)
> 

I think the UI approach here is looking good, but it doesn't seem to 
work very well. I'm getting multiple entries that show up for each test. 
Furthermore, I think we should also display the individual test name 
(not just the DLL name).

> diff --git a/programs/winetest/gui.c b/programs/winetest/gui.c
> index bda00f3707..fd6e74aca6 100644
> --- a/programs/winetest/gui.c
> +++ b/programs/winetest/gui.c
> @@ -2,6 +2,7 @@
>   * GUI support
>   *
>   * Copyright 2004 Ferenc Wagner
> + * Copyright 2018-2019 Isira Seneviratne
>   *
>   * This library is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU Lesser General Public
> @@ -43,6 +44,9 @@ static int progressGroup;
>  
>  static WNDPROC DefEditProc;
>  
> +/* List view handle */
> +HWND res_list_view;
> +
>  static int
>  MBdefault (int uType)
>  {
> @@ -130,7 +134,7 @@ guiStep (va_list ap)
>  {
>      const int pgID = IDC_ST0 + progressGroup * 2;
>      char *str = vstrmake (NULL, ap);
> -    
> +
>      progressCurr++;
>      SetDlgItemTextA (dialog, pgID, str);
>      SendDlgItemMessageA(dialog, pgID+1, PBM_SETPOS,
> @@ -421,6 +425,8 @@ AboutProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
>  static INT_PTR CALLBACK
>  DlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
>  {
> +    LVCOLUMNA lvCol;
> +
>      switch (msg) {
>      case WM_INITDIALOG:
>          SendMessageA(hwnd, WM_SETICON, ICON_SMALL,
> @@ -430,6 +436,21 @@ DlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
>          SendMessageA(hwnd, WM_SETICON, ICON_BIG,
>                       (LPARAM)LoadIconA( GetModuleHandleA(NULL), MAKEINTRESOURCEA(IDI_WINE)));
>          dialog = hwnd;
> +
> +        /* Initializes the list view control that the main dialog window contains */
> +        res_list_view = GetDlgItem(dialog, IDD_RES_LIST);
> +
> +        lvCol.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
> +        lvCol.cx = 80;
> +        lvCol.fmt = LVCFMT_LEFT;
> +
> +        lvCol.pszText = (char *) "Component";
> +        ListView_InsertColumnA(res_list_view, 0, &lvCol);
> +
> +        lvCol.pszText = (char *) "No. of failures";
> +        lvCol.cx = 100;
> +        ListView_InsertColumnA(res_list_view, 1, &lvCol);
> +

I'm not sure if there's an unofficial policy in this respect, but I get 
the impression that we try to avoid windowsx.h macros, in favour of 
using e.g. SendMessageA() directly. But I'd welcome anyone else to 
comment on this (or if it's not worth fixing).



More information about the wine-devel mailing list