[gnumeric] sstest: move internal-use function out of libgnumeric



commit 340c574e46a112d18da9e5ef7c4a2f0cc3c83eb8
Author: Morten Welinder <terra gnome org>
Date:   Wed Nov 29 19:07:30 2017 -0500

    sstest: move internal-use function out of libgnumeric

 ChangeLog         |    2 ++
 src/libgnumeric.c |   19 -------------------
 src/libgnumeric.h |    3 ---
 src/sstest.c      |   38 ++++++++++++++++++++++++--------------
 4 files changed, 26 insertions(+), 36 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d34ff98..3a3f915 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2017-11-29  Morten Welinder  <terra gnome org>
 
+       * src/libgnumeric.c (gnm_dump_func_defs): Not needed anymore.
+
        * src/main-application.c (pathetic_qt_workaround): Not needed
        anymore.
 
diff --git a/src/libgnumeric.c b/src/libgnumeric.c
index 2d1a17e..da5ae5c 100644
--- a/src/libgnumeric.c
+++ b/src/libgnumeric.c
@@ -337,25 +337,6 @@ gnm_init (void)
                                  gnm_app_display_dpi_get (FALSE));
 }
 
-/*
- * TODO : do we really want this here ?
- * seems like a better fit in main-application.c
- */
-int
-gnm_dump_func_defs (char const* filename, int dump_type)
-{
-       int retval;
-       GOCmdContext *cc = gnm_cmd_context_stderr_new ();
-
-       gnm_plugins_init (cc);
-       if ((retval = gnm_cmd_context_stderr_get_status (GNM_CMD_CONTEXT_STDERR (cc))) == 0)
-               function_dump_defs (filename, dump_type);
-
-       g_object_unref (cc);
-
-       return retval;
-}
-
 void
 gnm_shutdown (void)
 {
diff --git a/src/libgnumeric.h b/src/libgnumeric.h
index 697becb..06a3d98 100644
--- a/src/libgnumeric.h
+++ b/src/libgnumeric.h
@@ -27,9 +27,6 @@ GOptionGroup *gnm_get_option_group (void);
 
 GNM_VAR_DECL gboolean  initial_workbook_open_complete;
 
-/* Internal */
-int gnm_dump_func_defs (char const* filename, int dump_type); /* changes as needed */
-
 G_END_DECLS
 
 #endif /* _GNM_LIBGNUMERIC_H_ */
diff --git a/src/sstest.c b/src/sstest.c
index 85fff58..e85f137 100644
--- a/src/sstest.c
+++ b/src/sstest.c
@@ -1,7 +1,7 @@
 /*
  * sstest.c: Test code for Gnumeric
  *
- * Copyright (C) 2009 Morten Welinder (terra gnome org)
+ * Copyright (C) 2009,2017 Morten Welinder (terra gnome org)
  */
 #include <gnumeric-config.h>
 #include "gnumeric.h"
@@ -87,6 +87,8 @@ static GOptionEntry const sstest_options [] = {
        { NULL }
 };
 
+/* ------------------------------------------------------------------------- */
+
 static void
 mark_test_start (const char *name)
 {
@@ -278,7 +280,7 @@ test_insdel_rowcol_names (void)
        mark_test_end (test_name);
 }
 
-/*-------------------------------------------------------------------------- */
+/* ------------------------------------------------------------------------- */
 
 static void
 test_insert_delete (void)
@@ -346,7 +348,7 @@ test_insert_delete (void)
        mark_test_end (test_name);
 }
 
-/*-------------------------------------------------------------------------- */
+/* ------------------------------------------------------------------------- */
 
 static void
 test_func_help (void)
@@ -362,7 +364,7 @@ test_func_help (void)
        mark_test_end (test_name);
 }
 
-/*-------------------------------------------------------------------------- */
+/* ------------------------------------------------------------------------- */
 
 static int
 test_strtol_ok (const char *s, long l, size_t expected_len)
@@ -562,7 +564,7 @@ test_nonascii_numbers (void)
        mark_test_end (test_name);
 }
 
-/*-------------------------------------------------------------------------- */
+/* ------------------------------------------------------------------------- */
 
 static char *random_summary = NULL;
 
@@ -2643,7 +2645,7 @@ test_random (void)
        mark_test_end (test_name);
 }
 
-/*-------------------------------------------------------------------------- */
+/* ------------------------------------------------------------------------- */
 
 #define MAYBE_DO(name) if (strcmp (testname, "all") != 0 && strcmp (testname, (name)) != 0) { } else
 
@@ -2689,14 +2691,22 @@ main (int argc, char const **argv)
                go_error_info_free (plugin_errs);
        }
 
-       if (func_state_file)
-               return gnm_dump_func_defs (func_state_file, 0);
-       if (func_def_file)
-               return gnm_dump_func_defs (func_def_file, 1);
-       if (ext_refs_file)
-               return gnm_dump_func_defs (ext_refs_file, 4);
-       if (samples_file)
-               return gnm_dump_func_defs (samples_file, 5);
+       if (func_state_file) {
+               function_dump_defs (func_state_file, 0);
+               return 0;
+       }
+       if (func_def_file) {
+               function_dump_defs (func_def_file, 1);
+               return 0;
+       }
+       if (ext_refs_file) {
+               function_dump_defs (ext_refs_file, 4);
+               return 0;
+       }
+       if (samples_file) {
+               function_dump_defs (samples_file, 5);
+               return 0;
+       }
 
        testname = argv[1];
        if (!testname) testname = "all";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]