summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6feb6c1)
raw | patch | inline | side by side (parent: 6feb6c1)
author | Johan Engelen <goejendaagh@zonnet.nl> | |
Sat, 5 Dec 2009 22:30:27 +0000 (23:30 +0100) | ||
committer | Johan Engelen <goejendaagh@zonnet.nl> | |
Sat, 5 Dec 2009 22:30:27 +0000 (23:30 +0100) |
build.xml | patch | blob | history | |
src/Makefile_insert | patch | blob | history | |
src/marker-test.h | [new file with mode: 0644] | patch | blob |
src/sp-marker-loc.h | patch | blob | history |
diff --git a/build.xml b/build.xml
index 2606a3210a8a39a5eb4b982361c10d365d94f127..d8c62e5f27333eb7485c32b7e29e3f4ad7c293c0 100644 (file)
--- a/build.xml
+++ b/build.xml
<include name="color-profile-test.h"/>
<include name="dir-util-test.h"/>
<include name="extract-uri-test.h"/>
+ <include name="marker-test.h"/>
<include name="mod360-test.h"/>
<include name="preferences-test.h"/>
<include name="round-test.h"/>
diff --git a/src/Makefile_insert b/src/Makefile_insert
index da49187bacb5dd840bb07828e54ada293a3e9c6c..b32889f65278492e839a2153b9ddd4eb3a3d0d3e 100644 (file)
--- a/src/Makefile_insert
+++ b/src/Makefile_insert
$(srcdir)/color-profile-test.h \
$(srcdir)/dir-util-test.h \
$(srcdir)/extract-uri-test.h \
+ $(srcdir)/marker-test.h \
$(srcdir)/mod360-test.h \
$(srcdir)/round-test.h \
$(srcdir)/preferences-test.h \
diff --git a/src/marker-test.h b/src/marker-test.h
--- /dev/null
+++ b/src/marker-test.h
@@ -0,0 +1,39 @@
+/** @file
+ * @brief Unit tests for SVG marker handling
+ */
+/* Authors:
+ * Johan Engelen <goejendaagh@zonnet.nl>
+ *
+ * This file is released into the public domain.
+ */
+
+#include <cxxtest/TestSuite.h>
+
+#include "sp-marker-loc.h"
+
+class MarkerTest : public CxxTest::TestSuite
+{
+public:
+
+ void testMarkerLoc()
+ {
+ // code depends on these *exact* values, so check them here.
+ TS_ASSERT_EQUALS(SP_MARKER_LOC, 0);
+ TS_ASSERT_EQUALS(SP_MARKER_LOC_START, 1);
+ TS_ASSERT_EQUALS(SP_MARKER_LOC_MID, 2);
+ TS_ASSERT_EQUALS(SP_MARKER_LOC_END, 3);
+ TS_ASSERT_EQUALS(SP_MARKER_LOC_QTY, 4);
+ }
+
+};
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/sp-marker-loc.h b/src/sp-marker-loc.h
index 98cab3746450da5a274243c05fa7f19ab084aa36..b6877e5aacc672d0f515465f53014ae323e270dc 100644 (file)
--- a/src/sp-marker-loc.h
+++ b/src/sp-marker-loc.h
* These enums are to allow us to have 4-element arrays that represent a set of marker locations
* (all, start, mid, and end). This allows us to iterate through the array in places where we need
* to do a process across all of the markers, instead of separate code stanzas for each.
+ *
+ * IMPORTANT: the code assumes that the locations have the values as written below! so don't change the values!!!
*/
enum SPMarkerLoc {
SP_MARKER_LOC = 0,