Ticket #3542: mc-3542-fix-editor-tests-segfault-on-ncurses.patch

File mc-3542-fix-editor-tests-segfault-on-ncurses.patch, 1.4 KB (added by and, 4 years ago)
  • tests/src/editor/editcmd__edit_complete_word_cmd.c

    fix /src/editor testsuite failure when ncurses is used
    
     Running suite /src/editor
     (null):-1:S:Core:test_autocomplete:0: (after this point) Received signal 11 (Segmentation fault)
     (null):-1:S:Core:test_autocomplete:1: (after this point) Received signal 11 (Segmentation fault)
     (null):-1:S:Core:test_autocomplete_single:0: (after this point) Received signal 11 (Segmentation fault)
     Results for all suites run:
     0%: Checks: 3, Failures: 0, Errors: 3
    
    testsuite failed because ncurses:doupdate() called without proper init
    
     edit_init()
       -> edit_load_file()
          -> edit_load_file_fast()
             -> status_msg_init()
                -> mc_refesh()
                   -> tty_refresh()
                      -> doupdate()
    
    patch against 52fd328042a426e885da891c8ce8218cda3a1cf7
    compile test with GCC 5.2.0/ncurses 5.9
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    3434#include "lib/charsets.h" 
    3535#endif 
    3636#include "lib/strutil.h" 
     37#ifdef USE_NCURSES 
     38#include "lib/tty/tty.h" 
     39#endif 
    3740 
    3841#include "src/vfs/local/local.c" 
    3942#ifdef HAVE_CHARSET 
     
    151154    vfs_init (); 
    152155    init_localfs (); 
    153156    vfs_setup_work_dir (); 
    154  
     157#ifdef USE_NCURSES 
     158    initscr(); 
     159#endif /* USE_NCURSES */ 
    155160#ifdef HAVE_CHARSET 
    156161    mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; 
    157162    load_codepages_list ();