add fsm_dealloc_test.c

Despite efforts to properly handle "GONE" events and entering a ST_DESTROYING
only once, so far this test runs straight into a heap use-after-free. With
current fsm.c, it is hard to resolve the situation with the objects named
"other" also causing deallocations besides the FSM instance parent/child
relations.

For illustration, add an "expected" test output file fsm_dealloc_test.err,
making this pass will follow in a subsequent patch.

Change-Id: If801907c541bca9f524c9e5fd22ac280ca16979a
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d123ee2..09a1c18 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -51,7 +51,11 @@
 endif
 
 if ENABLE_CTRL
-check_PROGRAMS += ctrl/ctrl_test fsm/fsm_test
+check_PROGRAMS += \
+	ctrl/ctrl_test \
+	fsm/fsm_test \
+	fsm/fsm_dealloc_test \
+	$(NULL)
 endif
 
 if ENABLE_STATS_TEST
@@ -207,6 +211,9 @@
 	$(top_builddir)/src/gsm/libosmogsm.la \
 	$(top_builddir)/src/vty/libosmovty.la
 
+fsm_fsm_dealloc_test_SOURCES = fsm/fsm_dealloc_test.c
+fsm_fsm_dealloc_test_LDADD = $(LDADD)
+
 write_queue_wqueue_test_SOURCES = write_queue/wqueue_test.c
 
 socket_socket_test_SOURCES = socket/socket_test.c