newsAdvanced Gtk+ Sequencer - News

 
 

Facts matter - no more magic

Item posted by Joël Krähemann <jkraehemann> on Fri 31 Mar 2017 11:01:19 PM UTC.

Functional testing is mandatory in order to ensure the robustness of your application. GSequencer has got recently a basic functional test setup.

#include <ags/test/X/ags_functional_test_util.h> does mainly the job. It shall give you full automated testing control over Advanced Gtk+ Sequencer. The very first functional test using it is ags_functional_machine_add_and_destroy_test.c

It does for each built-in machine add it and destroy. This happens by calling g_signal_emit_by_name() and alike. Below you see the output of running within valgrind. If you ever tried to debug a GUI within valgrind, you know that can be quiet annoying. As the GUI's reaction is very slow.


Run Summary:    Type  Total    Ran Passed Failed Inactive
              suites      1      1    n/a      0        0
               tests      6      6      6      0        0
             asserts     12     12     12      0      n/a

Elapsed time =  315.519 seconds
--11545-- Discarding syms at 0x123412b0-0x12345745 in /lib/x86_64-linux-gnu/libnss_compat-2.24.so due to munmap()
--11545-- Discarding syms at 0x127620e0-0x127683f7 in /lib/x86_64-linux-gnu/libnss_nis-2.24.so due to munmap()
--11545-- Discarding syms at 0x1254bfd0-0x125572d1 in /lib/x86_64-linux-gnu/libnsl-2.24.so due to munmap()
--11545-- Discarding syms at 0x1296e1d0-0x12973e91 in /lib/x86_64-linux-gnu/libnss_files-2.24.so due to munmap()
==11545==
==11545== HEAP SUMMARY:
==11545==     in use at exit: 11,754,001 bytes in 131,157 blocks
==11545==   total heap usage: 3,963,847 allocs, 3,832,690 frees, 252,324,723 bytes allocated
==11545==
==11545== Searching for pointers to 126,822 not-freed blocks
==11545== Checked 210,116,160 bytes
==11545==
==11545== LEAK SUMMARY:
==11545==    definitely lost: 616,416 bytes in 18,032 blocks
==11545==    indirectly lost: 3,322,929 bytes in 30,482 blocks
==11545==      possibly lost: 67,131 bytes in 229 blocks
==11545==    still reachable: 7,101,973 bytes in 78,079 blocks
==11545==                       of which reachable via heuristic:
==11545==                         length64           : 27,128 bytes in 326 blocks
==11545==                         newarray           : 2,416 bytes in 71 blocks
==11545==         suppressed: 0 bytes in 0 blocks
==11545== Rerun with --leak-check=full to see details of leaked memory
==11545==
==11545== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==11545== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


Fixed memory corruption


The benefits are evident of functional testing. Just figured out a memory corruption as destroying AgsFFPlayer. There was some other wicked things going on. I was able to trigger SIGTRAP by calling following during the start of the test.


g_log_set_fatal_mask(G_LOG_DOMAIN,
                     G_LOG_LEVEL_CRITICAL);


For now, the functional testing is going to be extended.

Bests,
Joël

Back to the top

Powered by Savane 3.14-3b9d.
Corresponding source code