[gnome-commander/googletest] Adds existing test for search algorithm in internal viewer to "make check"



commit 59a35a7d4d6b27ecece9aedae9492bb5c1695229
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Sun Oct 18 21:25:55 2015 +0200

    Adds existing test for search algorithm in internal viewer to "make check"

 tests/Makefile.am                                  |    7 ++++++-
 .../{gviewer/bm_byte_test.c => iv_bm_byte_test.cc} |   18 +++++++-----------
 tests/iv_fileops_test.h                            |    2 +-
 3 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1502186..05d8bd8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,11 +15,16 @@ INTVLIBS = \
        $(top_builddir)/src/intviewer/libgviewer.a
 
 TESTS = \
-       intviewer_fileops
+       intviewer_fileops \
+       intviewer_bm_byte
 check_PROGRAMS = $(TESTS)
 
 intviewer_fileops_SOURCES = iv_fileops_test.cc gcmd_tests_main.cc 
 intviewer_fileops_CXXFLAGS = $(INTVLIBS)
 intviewer_fileops_LDFLAGS = $(INTVLIBS) -lgtest
 
+intviewer_bm_byte_SOURCES = iv_bm_byte_test.cc gcmd_tests_main.cc 
+intviewer_bm_byte_CXXFLAGS = $(INTVLIBS)
+intviewer_bm_byte_LDFLAGS = $(INTVLIBS) -lgtest
+
 -include $(top_srcdir)/git.mk
diff --git a/tests/gviewer/bm_byte_test.c b/tests/iv_bm_byte_test.cc
similarity index 93%
rename from tests/gviewer/bm_byte_test.c
rename to tests/iv_bm_byte_test.cc
index 783a8f5..297682b 100644
--- a/tests/gviewer/bm_byte_test.c
+++ b/tests/iv_bm_byte_test.cc
@@ -2,7 +2,7 @@
   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
+  Copyright (C) 2013-2015 Uwe Scholz
 
   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
@@ -17,17 +17,15 @@
   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 <libgviewer/gvtypes.h>
-#include <libgviewer/bm_byte.h>
+#include "gtest/gtest.h"
+#include <iv_bm_byte_test.h>
+
+BmByteTest::BmByteTest() {}
+BmByteTest::~BmByteTest() {}
 
-int main()
-{
+TEST_F(BmByteTest, match_test) {
     const guint8 pattern[] = { 0x01, 0x04, 0xB4, 0xFE, 0x01, 0x01, 0x04};
     const guint8 text[] = {
 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
@@ -84,6 +82,4 @@ int main()
     }
 
     free_bm_byte_data(data);
-
-    return 0;
 }
diff --git a/tests/iv_fileops_test.h b/tests/iv_fileops_test.h
index 240c144..23550cd 100644
--- a/tests/iv_fileops_test.h
+++ b/tests/iv_fileops_test.h
@@ -26,7 +26,7 @@
 #include <intviewer/gvtypes.h>
 #include <intviewer/fileops.h>
 
-// The fixture for testing class Foo.
+// The fixture for testing class FileOpsTest.
 class FileOpsTest : public ::testing::Test {
  protected:
   FileOpsTest();


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