Changeset 1afcbe for src/Patterns/unittests
- Timestamp:
- Jan 5, 2011, 11:08:49 AM (15 years ago)
- Children:
- d76c105
- Parents:
- 724564
- Location:
- src/Patterns/unittests
- Files:
-
- 4 added
- 4 edited
-
CloneUnitTest.cpp (added)
-
CloneUnitTest.hpp (added)
-
Makefile.am (modified) (2 diffs)
-
stubs/CloneStub.cpp (added)
-
stubs/CloneStub.hpp (added)
-
stubs/CommonStub.cpp (modified) (2 diffs)
-
stubs/CommonStub.hpp (modified) (3 diffs)
-
stubs/FactoryStub.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Patterns/unittests/Makefile.am
r724564 r1afcbe 10 10 TESTS = \ 11 11 CacheableUnitTest \ 12 CloneUnitTest \ 12 13 CreatorUnitTest \ 13 14 FactoryUnitTest \ … … 32 33 ../ObserverIterator.hpp 33 34 CacheableUnitTest_LDADD = $(TESTLIBS) 35 36 CloneUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 37 CloneUnitTest.cpp \ 38 CloneUnitTest.hpp \ 39 ../Clone.hpp \ 40 stubs/CommonStub.cpp \ 41 stubs/CommonStub.hpp \ 42 stubs/CloneStub.cpp \ 43 stubs/CloneStub.hpp 44 CloneUnitTest_LDADD = $(TESTLIBS) 34 45 35 46 CreatorUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ -
src/Patterns/unittests/stubs/CommonStub.cpp
r724564 r1afcbe 21 21 22 22 namespace teststubs { 23 Iclass::~Iclass() {}; 24 23 25 Aclass::Aclass() : 24 26 counter(0) … … 27 29 Aclass::~Aclass() {}; 28 30 31 void Aclass::count() { 32 ++counter; 33 } 34 35 int Aclass::getcount() const { 36 return counter; 37 }; 38 39 void Aclass::setcount(int const _counter) { 40 counter = _counter; 41 }; 42 43 29 44 Bclass::Bclass() : 30 counter( 256)45 counter(0.) 31 46 {}; 32 47 33 48 Bclass::~Bclass() {}; 49 50 void Bclass::count() { 51 counter+=1.; 52 } 53 54 int Bclass::getcount() const { 55 return (int)counter; 56 }; 57 58 void Bclass::setcount(int const _counter) { 59 counter = (double)_counter; 60 }; 34 61 }; -
src/Patterns/unittests/stubs/CommonStub.hpp
r724564 r1afcbe 15 15 16 16 namespace teststubs { 17 class Aclass 17 class Iclass 18 { 19 public: 20 virtual ~Iclass(); 21 22 virtual void count() = 0; 23 virtual int getcount() const = 0; 24 virtual void setcount(int const _counter) = 0; 25 }; 26 27 class Aclass : 28 public Iclass 18 29 { 19 30 public: … … 21 32 ~Aclass(); 22 33 34 void count(); 35 int getcount() const; 36 void setcount(int const _counter); 37 23 38 int counter; 24 39 }; 25 40 26 class Bclass 41 class Bclass : 42 public Iclass 27 43 { 28 44 public: … … 30 46 ~Bclass(); 31 47 32 int counter; 48 void count(); 49 int getcount() const; 50 void setcount(int const _counter); 51 52 double counter; 33 53 }; 34 54 }; -
src/Patterns/unittests/stubs/FactoryStub.hpp
r724564 r1afcbe 30 30 { 31 31 friend class Singleton<FactoryStub>; 32 friend class FactoryTest; 33 32 34 protected: 33 35 FactoryStub();
Note:
See TracChangeset
for help on using the changeset viewer.
