diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2016-08-30 22:19:16 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2016-08-30 22:19:16 +0000 |
| commit | d311eb86bbec90bd99244cf04f0f6145b3a80828 (patch) | |
| tree | fd800e2ef8e26f890a39917fdc7150be94dd6b75 /src/verbs-test.h | |
| parent | [Bug #1447971] User palettes not available if all shared system palettes are ... (diff) | |
| download | inkscape-d311eb86bbec90bd99244cf04f0f6145b3a80828.tar.gz inkscape-d311eb86bbec90bd99244cf04f0f6145b3a80828.zip | |
Drop unused cxxtest fork in favour of Googletest
Fixed bugs:
- https://launchpad.net/bugs/1094771
(bzr r15096)
Diffstat (limited to 'src/verbs-test.h')
| -rw-r--r-- | src/verbs-test.h | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/src/verbs-test.h b/src/verbs-test.h deleted file mode 100644 index 04a0b80c0..000000000 --- a/src/verbs-test.h +++ /dev/null @@ -1,86 +0,0 @@ - - -#include <cxxtest/TestSuite.h> - -#include "verbs.h" - -class VerbsTest : public CxxTest::TestSuite -{ -public: - - class TestHook : public Inkscape::Verb { - public: - static int getInternalTableSize() { return _getBaseListSize(); } - - private: - TestHook(); - }; - - void testEnumLength() - { - TS_ASSERT_DIFFERS( 0, static_cast<int>(SP_VERB_LAST) ); - TS_ASSERT_EQUALS( static_cast<int>(SP_VERB_LAST) + 1, TestHook::getInternalTableSize() ); - } - - void testEnumFixed() - { - TS_ASSERT_EQUALS( 0, static_cast<int>(SP_VERB_INVALID) ); - TS_ASSERT_EQUALS( 1, static_cast<int>(SP_VERB_NONE) ); - - TS_ASSERT_DIFFERS( 0, static_cast<int>(SP_VERB_LAST) ); - TS_ASSERT_DIFFERS( 1, static_cast<int>(SP_VERB_LAST) ); - } - - void testFetch() - { - for ( int i = 0; i < static_cast<int>(SP_VERB_LAST); i++ ) - { - char tmp[16]; - snprintf( tmp, sizeof(tmp), "Verb# %d", i ); - tmp[sizeof(tmp)-1] = 0; - std::string descr(tmp); - - Inkscape::Verb* verb = Inkscape::Verb::get(i); - TSM_ASSERT( descr, verb ); - if ( verb ) - { - TSM_ASSERT_EQUALS( descr, verb->get_code(), static_cast<unsigned int>(i) ); - - if ( i != static_cast<int>(SP_VERB_INVALID) ) - { - TSM_ASSERT( descr, verb->get_id() ); - TSM_ASSERT( descr, verb->get_name() ); - - Inkscape::Verb* bounced = verb->getbyid( verb->get_id() ); - // TODO - put this back once verbs are fixed - //TSM_ASSERT( descr, bounced ); - if ( bounced ) - { - TSM_ASSERT_EQUALS( descr, bounced->get_code(), static_cast<unsigned int>(i) ); - } - else - { - TS_FAIL( std::string("Unable to getbyid() for ") + descr + std::string(" ID: '") + std::string(verb->get_id()) + std::string("'") ); - } - } - else - { - TSM_ASSERT( std::string("SP_VERB_INVALID"), !verb->get_id() ); - TSM_ASSERT( std::string("SP_VERB_INVALID"), !verb->get_name() ); - } - } - } - } - -}; - -/* - 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:fileencoding=utf-8:textwidth=99 : |
