[gnome-commander/googletest: 16/38] Moved existing tests for internal viewer to tests directory
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/googletest: 16/38] Moved existing tests for internal viewer to tests directory
- Date: Mon, 9 Nov 2015 21:51:35 +0000 (UTC)
commit acdf5622ec760b6251961ba5bd5fcee699812a38
Author: Uwe Scholz <uwescholz src gnome org>
Date: Wed Nov 4 21:54:42 2015 +0100
Moved existing tests for internal viewer to tests directory
tests/Makefile.am | 35 +++++++-
tests/gviewer/Makefile.am | 62 -------------
tests/gviewer/search_dlg_test.c | 93 --------------------
tests/gviewer/viewerwindow.c | 65 --------------
.../dualrenderer.c => iv_dualrenderer_test.cc} | 8 ++-
.../imagerenderer.c => iv_imagerenderer_test.cc} | 2 +-
.../inputmodes.c => iv_inputmodes_test.cc} | 8 +-
.../textrenderer.c => iv_textrenderer_test.cc} | 19 +++--
tests/{gviewer/utils_test.c => iv_utils_test.cc} | 4 +-
.../viewerwidget.c => iv_viewerwidget_test.cc} | 2 +-
10 files changed, 59 insertions(+), 239 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d7cc125..beafc3a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,12 +15,45 @@ INTVLIBS = \
$(top_builddir)/src/intviewer/libgviewer.a
TESTS = \
+ intviewer_viewerwidget \
intviewer_fileops \
intviewer_bm_search \
- intviewer_datapresentation
+ intviewer_datapresentation \
+ intviewer_dualrenderer \
+ intviewer_imagerenderer \
+ intviewer_inputmodes \
+ intviewer_textrenderer
check_PROGRAMS = $(TESTS)
+intviewer_dualrenderer_SOURCES = iv_dualrenderer_test.cc
+intviewer_dualrenderer_CXXFLAGS = $(INTVLIBS)
+intviewer_dualrenderer_LDFLAGS = $(INTVLIBS) -lgtest
+
+intviewer_imagerenderer_SOURCES = iv_imagerenderer_test.cc
+intviewer_imagerenderer_CXXFLAGS = $(INTVLIBS)
+intviewer_imagerenderer_LDFLAGS = $(INTVLIBS) -lgtest
+
+intviewer_inputmodes_SOURCES = iv_inputmodes_test.cc
+intviewer_inputmodes_CXXFLAGS = $(INTVLIBS)
+intviewer_inputmodes_LDFLAGS = $(INTVLIBS) -lgtest
+
+intviewer_search_dlg_SOURCES = iv_search_dlg_test.cc
+intviewer_search_dlg_CXXFLAGS = $(INTVLIBS) -fpermissive
+intviewer_search_dlg_LDFLAGS = $(INTVLIBS) -lgtest
+
+intviewer_textrenderer_SOURCES = iv_textrenderer_test.cc
+intviewer_textrenderer_CXXFLAGS = $(INTVLIBS)
+intviewer_textrenderer_LDFLAGS = $(INTVLIBS) -lgtest
+
+intviewer_viewerwidget_SOURCES = iv_viewerwidget_test.cc
+intviewer_viewerwidget_CXXFLAGS = $(INTVLIBS)
+intviewer_viewerwidget_LDFLAGS = $(INTVLIBS) -lgtest
+
+intviewer_viewerwindow_SOURCES = iv_viewerwindow_test.cc
+intviewer_viewerwindow_CXXFLAGS = $(INTVLIBS)
+intviewer_viewerwindow_LDFLAGS = $(INTVLIBS) -lgtest
+
intviewer_fileops_SOURCES = iv_fileops_test.cc gcmd_tests_main.cc
intviewer_fileops_CXXFLAGS = $(INTVLIBS)
intviewer_fileops_LDFLAGS = $(INTVLIBS) -lgtest
diff --git a/tests/gviewer/dualrenderer.c b/tests/iv_dualrenderer_test.cc
similarity index 94%
rename from tests/gviewer/dualrenderer.c
rename to tests/iv_dualrenderer_test.cc
index 4010507..8919bf1 100644
--- a/tests/gviewer/dualrenderer.c
+++ b/tests/iv_dualrenderer_test.cc
@@ -30,7 +30,7 @@
#include <glib.h>
#include <gtk/gtk.h>
-#include <libgviewer/libgviewer.h>
+#include <intviewer/libgviewer.h>
int main(int argc, char *argv[])
@@ -83,7 +83,11 @@ int main(int argc, char *argv[])
gtk_widget_show(box);
gtk_widget_show(window);
- gtk_main();
+ while (g_main_context_pending(NULL))
+ {
+ g_main_context_iteration(NULL, FALSE);
+ }
+ gtk_widget_destroy (window);
return 0;
}
diff --git a/tests/gviewer/imagerenderer.c b/tests/iv_imagerenderer_test.cc
similarity index 98%
rename from tests/gviewer/imagerenderer.c
rename to tests/iv_imagerenderer_test.cc
index deb60a7..ecf1509 100644
--- a/tests/gviewer/imagerenderer.c
+++ b/tests/iv_imagerenderer_test.cc
@@ -29,7 +29,7 @@
#include <glib.h>
#include <gtk/gtk.h>
-#include <libgviewer/libgviewer.h>
+#include <intviewer/libgviewer.h>
static gchar *filename = NULL;
static gboolean best_fit = TRUE;
diff --git a/tests/gviewer/inputmodes.c b/tests/iv_inputmodes_test.cc
similarity index 96%
rename from tests/gviewer/inputmodes.c
rename to tests/iv_inputmodes_test.cc
index c11adc3..f581a41 100644
--- a/tests/gviewer/inputmodes.c
+++ b/tests/iv_inputmodes_test.cc
@@ -24,10 +24,10 @@
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
-#include <libgviewer/libgviewer.h>
-#include <libgviewer/gvtypes.h>
-#include <libgviewer/fileops.h>
-#include <libgviewer/inputmodes.h>
+#include <intviewer/libgviewer.h>
+#include <intviewer/gvtypes.h>
+#include <intviewer/fileops.h>
+#include <intviewer/inputmodes.h>
static offset_type start;
static offset_type end;
diff --git a/tests/gviewer/textrenderer.c b/tests/iv_textrenderer_test.cc
similarity index 91%
rename from tests/gviewer/textrenderer.c
rename to tests/iv_textrenderer_test.cc
index c0f51e0..2f96061 100644
--- a/tests/gviewer/textrenderer.c
+++ b/tests/iv_textrenderer_test.cc
@@ -29,11 +29,11 @@
#include <glib.h>
#include <gtk/gtk.h>
-#include <libgviewer/libgviewer.h>
+#include <intviewer/libgviewer.h>
static gchar *filename = NULL;
static gchar *encoding = NULL;
-static TEXTDISPLAYMODE dispmode = TR_DISP_MODE_TEXT;
+static TextRender::DISPLAYMODE dispmode = TextRender::DISPLAYMODE_TEXT;
static guint tab_size;
static guint fixed_limit;
static gboolean wrap_mode;
@@ -61,7 +61,7 @@ void parse_command_line(int argc, char *argv[])
tab_size = 8;
fixed_limit = 40;
- dispmode = TR_DISP_MODE_TEXT;
+ dispmode = TextRender::DISPLAYMODE_TEXT;
encoding = g_strdup("ASCII");
wrap_mode = FALSE;
@@ -80,11 +80,11 @@ void parse_command_line(int argc, char *argv[])
case 'd':
if (g_ascii_strcasecmp(optarg,"fixed")==0)
- dispmode = TR_DISP_MODE_TEXT;
+ dispmode = TextRender::DISPLAYMODE_TEXT;
else if (g_ascii_strcasecmp(optarg,"binary")==0)
- dispmode = TR_DISP_MODE_BINARY;
+ dispmode = TextRender::DISPLAYMODE_BINARY;
else if (g_ascii_strcasecmp(optarg,"hex")==0)
- dispmode = TR_DISP_MODE_HEXDUMP;
+ dispmode = TextRender::DISPLAYMODE_HEXDUMP;
else
{
g_warning("Invalid display mode \"%s\".\n", optarg);
@@ -162,7 +162,10 @@ int main(int argc, char *argv[])
gtk_widget_show(scrollbox);
gtk_widget_show(window);
- gtk_main();
-
+ while (g_main_context_pending(NULL))
+ {
+ g_main_context_iteration(NULL, FALSE);
+ }
+ gtk_widget_destroy (window);
return 0;
}
diff --git a/tests/gviewer/utils_test.c b/tests/iv_utils_test.cc
similarity index 83%
rename from tests/gviewer/utils_test.c
rename to tests/iv_utils_test.cc
index 4ea4e9c..ad693d6 100644
--- a/tests/gviewer/utils_test.c
+++ b/tests/iv_utils_test.cc
@@ -1,7 +1,7 @@
#include <glib.h>
#include <stdio.h>
-#include <libgviewer/gvtypes.h>
-#include <libgviewer/viewer-utils.h>
+#include <intviewer/gvtypes.h>
+#include <intviewer/viewer-utils.h>
void test_text2hex()
diff --git a/tests/gviewer/viewerwidget.c b/tests/iv_viewerwidget_test.cc
similarity index 99%
rename from tests/gviewer/viewerwidget.c
rename to tests/iv_viewerwidget_test.cc
index 4353f21..32ad542 100644
--- a/tests/gviewer/viewerwidget.c
+++ b/tests/iv_viewerwidget_test.cc
@@ -29,7 +29,7 @@
#include <glib.h>
#include <gtk/gtk.h>
-#include <libgviewer/libgviewer.h>
+#include <intviewer/libgviewer.h>
static gchar *filename = NULL;
static gchar *encoding = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]