[gnome-commander/googletest: 37/38] Integrates dualrenderer test to googletest framework



commit bdd07256282f733c722268c4f515ad0ba37f3102
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Mon Nov 9 20:21:40 2015 +0100

    Integrates dualrenderer test to googletest framework

 tests/Makefile.am             |    2 +-
 tests/iv_dualrenderer_test.cc |   71 +++++++++++++++++-----------------------
 2 files changed, 31 insertions(+), 42 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index beafc3a..4e82d49 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -26,7 +26,7 @@ TESTS = \
 
 check_PROGRAMS = $(TESTS)
 
-intviewer_dualrenderer_SOURCES = iv_dualrenderer_test.cc
+intviewer_dualrenderer_SOURCES = iv_dualrenderer_test.cc gcmd_tests_main.cc
 intviewer_dualrenderer_CXXFLAGS = $(INTVLIBS)
 intviewer_dualrenderer_LDFLAGS = $(INTVLIBS) -lgtest
 
diff --git a/tests/iv_dualrenderer_test.cc b/tests/iv_dualrenderer_test.cc
index 8919bf1..34f60ed 100644
--- a/tests/iv_dualrenderer_test.cc
+++ b/tests/iv_dualrenderer_test.cc
@@ -1,47 +1,38 @@
-/*
-  GNOME Commander - A GNOME based file manager
-  Copyright (C) 2001-2006 Marcus Bjurman
-  Copyright (C) 2007-2012 Piotr Eljasiak
-    Copyright (C) 2013-2015 Uwe Scholz
+/**
+ * @file iv_dualrenderer_test.cc
+ * @brief Part of GNOME Commander - A GNOME based file manager
+ *
+ * @copyright (C) 2006 Assaf Gordon\n
+ * @copyright (C) 2007-2012 Piotr Eljasiak\n
+ * @copyright (C) 2013-2015 Uwe Scholz\n
+ *
+ * @copyright This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * @copyright This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * @copyright You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "gtest/gtest.h"
+#include <iv_dualrenderer_test.h>
+
+TEST_F(DualRendererTest, dualrenderer_test) {
 
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-   Author: Assaf Gordon  <agordon88 gmail com>
-*/
-
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <err.h>
-
-#include <glib.h>
-#include <gtk/gtk.h>
-
-#include <intviewer/libgviewer.h>
-
-
-int main(int argc, char *argv[])
-{
     GtkWidget *window;
     GtkWidget *tscrollbox, *iscrollbox;
     GtkWidget *imgr;
     GtkWidget *textr;
     GtkWidget *box;
 
-    gtk_init(&argc,&argv);
+    gtk_init(NULL, NULL);
 
     window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     gtk_container_set_border_width (GTK_CONTAINER (window), 0);
@@ -55,7 +46,7 @@ int main(int argc, char *argv[])
         scroll_box_get_v_adjustment(SCROLL_BOX(iscrollbox)));
     image_render_set_h_adjustment(IMAGE_RENDER(imgr),
         scroll_box_get_h_adjustment(SCROLL_BOX(iscrollbox)));
-    image_render_load_file(IMAGE_RENDER(imgr), "/home/assaf/Projects/gnome-cmd/00012.jpg");
+    image_render_load_file(IMAGE_RENDER(imgr), "../pixmaps/gnome-commander.png");
     image_render_set_best_fit(IMAGE_RENDER(imgr), TRUE);
     image_render_set_scale_factor(IMAGE_RENDER(imgr), 1);
     scroll_box_set_client(SCROLL_BOX(iscrollbox),imgr);
@@ -71,7 +62,7 @@ int main(int argc, char *argv[])
         scroll_box_get_v_adjustment(SCROLL_BOX(tscrollbox)));
     text_render_set_h_adjustment(TEXT_RENDER(textr),
         scroll_box_get_h_adjustment(SCROLL_BOX(tscrollbox)));
-    text_render_load_file(TEXT_RENDER(textr), "/home/assaf/Projects/gnome-cmd/00012.txt");
+    text_render_load_file(TEXT_RENDER(textr), "../INSTALL");
     scroll_box_set_client(SCROLL_BOX(tscrollbox),textr);
     gtk_widget_show(textr);
     gtk_widget_show(tscrollbox);
@@ -88,6 +79,4 @@ int main(int argc, char *argv[])
         g_main_context_iteration(NULL, FALSE);
     }
     gtk_widget_destroy (window);
-
-    return 0;
 }


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