aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp.test/inc/dsa.h
diff options
context:
space:
mode:
authorcathook <b01902109@csie.ntu.edu.tw>2014-06-01 13:56:57 +0800
committercathook <b01902109@csie.ntu.edu.tw>2014-06-01 13:56:57 +0800
commitd5052f1c296dddf51b3e83d59bf3e3c1952cb2d0 (patch)
tree16f7920c5079e0aefcf9509d2dbab59c464d42bd /meowpp.test/inc/dsa.h
parentbd58f63900410ec4764031f2e6de2d75e91434b3 (diff)
downloadmeow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.tar.gz
meow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.tar.zst
meow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.zip
big chnage
Diffstat (limited to 'meowpp.test/inc/dsa.h')
-rw-r--r--meowpp.test/inc/dsa.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/meowpp.test/inc/dsa.h b/meowpp.test/inc/dsa.h
new file mode 100644
index 0000000..93de295
--- /dev/null
+++ b/meowpp.test/inc/dsa.h
@@ -0,0 +1,30 @@
+#ifndef __meowpp_h__
+#define __meowpp_h__
+
+#include "meowpp/Usage.h"
+#include "meowpp/oo/ObjBase.h"
+#include "meowpp/oo/ObjSelector.h"
+
+extern int count;
+
+class TestFunction: public meow::ObjBase{
+ public:
+ virtual ~TestFunction(){ };
+ virtual bool run() = 0;
+ virtual std::string name () const = 0;
+ virtual std::string description() const = 0;
+};
+
+#define TEST(__A,__B) \
+class Test##__A: public TestFunction{ \
+ public: \
+ \
+ meow::ObjBase* create() const{ return new Test##__A(); } \
+ bool run(); \
+ std::string name() const{ return std::string(#__A); } \
+ std::string description() const{ return std::string(__B); } \
+}; \
+static meow::ObjSelector<0> _(meow::stringPrintf("%d", count++), new Test##__A(), true); \
+inline bool Test##__A::run()
+
+#endif // __meowpp_h__