diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2009-12-05 22:30:27 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2009-12-05 22:30:27 +0000 |
| commit | 0b073c684fd15710d06a3824a7b003fdfd780d8d (patch) | |
| tree | 5bb5af8ccf888af7ec8e3edb67c5141315e2a08a | |
| parent | Text alignment is now taken into account when snapping a text object (diff) | |
| download | inkscape-0b073c684fd15710d06a3824a7b003fdfd780d8d.tar.gz inkscape-0b073c684fd15710d06a3824a7b003fdfd780d8d.zip | |
add cxxtests for marker_loc enum. code depends on the exact values of the enumeration.
(bzr r8868)
| -rw-r--r-- | build.xml | 1 | ||||
| -rw-r--r-- | src/Makefile_insert | 1 | ||||
| -rw-r--r-- | src/marker-test.h | 39 | ||||
| -rw-r--r-- | src/sp-marker-loc.h | 2 |
4 files changed, 43 insertions, 0 deletions
@@ -212,6 +212,7 @@ <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 da49187ba..b32889f65 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -271,6 +271,7 @@ CXXTEST_TESTSUITES += \ $(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 new file mode 100644 index 000000000..5b84dcc66 --- /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 98cab3746..b6877e5aa 100644 --- a/src/sp-marker-loc.h +++ b/src/sp-marker-loc.h @@ -5,6 +5,8 @@ * 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, |
