[easytag/wip/test-scan: 15/15] Add simple scanner test
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/test-scan: 15/15] Add simple scanner test
- Date: Sat, 8 Mar 2014 11:15:20 +0000 (UTC)
commit c1e3082e75864d71c6ecf64dd503ae65f1571b50
Author: David King <amigadave amigadave com>
Date: Sat Mar 8 10:54:40 2014 +0000
Add simple scanner test
Makefile.am | 21 ++++++++++++++++++++-
tests/test-scan.c | 18 ++++++++++++++++++
2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 36935d3..312c312 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -123,6 +123,24 @@ easytag_LDADD = \
$(ID3LIB_LIBS) \
$(easytag_rc)
+check_PROGRAMS = tests/test-scan
+tests_test_scan_CPPFLAGS = \
+ -I$(top_srcdir)/src \
+ -I$(top_builddir) \
+ $(DEPRECATED_CPPFLAGS)
+
+tests_test_scan_CFLAGS = \
+ $(WARN_CFLAGS) \
+ $(EASYTAG_CFLAGS)
+
+tests_test_scan_SOURCES = \
+ tests/test-scan.c \
+ src/scan.c
+
+tests_test_scan_LDADD = \
+ $(EASYTAG_LIBS) \
+ $(ID3LIB_LIBS)
+
if WINDOWS_HOST
ICONDIR = $(srcdir)/data/icons/win32
MANIFESTDIR = $(srcdir)/src/win32
@@ -273,7 +291,8 @@ check_SCRIPTS = \
tests/test-desktop-file-validate.sh
TESTS = \
- $(check_SCRIPTS)
+ $(check_SCRIPTS) \
+ tests/test-scan
endif
CLEANFILES = \
diff --git a/tests/test-scan.c b/tests/test-scan.c
new file mode 100644
index 0000000..fca2ae6
--- /dev/null
+++ b/tests/test-scan.c
@@ -0,0 +1,18 @@
+#include <gtk/gtk.h>
+#include "scan.h"
+
+static void
+scanTest (void)
+{
+ gchar *string = "STRING_A_B";
+ Scan_Convert_Underscore_Into_Space (string);
+ g_assert_cmpstr (string, ==, "STRING A B");
+}
+
+int
+main (int argc, char** argv)
+{
+ g_test_init (&argc, &argv, NULL);
+ g_test_add_func ("/scantest", scanTest);
+ return g_test_run ();
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]