[Assorted-commits] SF.net SVN: assorted:[1266] cpp-commons/trunk/src/test
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-03-07 21:15:31
|
Revision: 1266 http://assorted.svn.sourceforge.net/assorted/?rev=1266&view=rev Author: yangzhang Date: 2009-03-07 21:15:20 +0000 (Sat, 07 Mar 2009) Log Message: ----------- added test.h, refactoring out common test code Modified Paths: -------------- cpp-commons/trunk/src/test/streamreader.cc cpp-commons/trunk/src/test/streamwriter.cc Added Paths: ----------- cpp-commons/trunk/src/test/test.h Modified: cpp-commons/trunk/src/test/streamreader.cc =================================================================== --- cpp-commons/trunk/src/test/streamreader.cc 2009-03-06 21:17:27 UTC (rev 1265) +++ cpp-commons/trunk/src/test/streamreader.cc 2009-03-07 21:15:20 UTC (rev 1266) @@ -1,8 +1,6 @@ #include <commons/array.h> #include <commons/streamreader.h> -#include <gtest/gtest.h> -using namespace commons; -using namespace testing; +#include "test.h" struct rfn { size_t chunklen_; @@ -62,8 +60,3 @@ } } } - -int main(int argc, char **argv) { - InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} Modified: cpp-commons/trunk/src/test/streamwriter.cc =================================================================== --- cpp-commons/trunk/src/test/streamwriter.cc 2009-03-06 21:17:27 UTC (rev 1265) +++ cpp-commons/trunk/src/test/streamwriter.cc 2009-03-07 21:15:20 UTC (rev 1266) @@ -1,8 +1,6 @@ #include <commons/array.h> #include <commons/streamwriter.h> -#include <gtest/gtest.h> -using namespace commons; -using namespace testing; +#include "test.h" struct wfn { array<char> &dst_; @@ -27,8 +25,3 @@ EXPECT_EQ(i, *(reinterpret_cast<int*>(dst.get()) + i + 1)); } } - -int main(int argc, char **argv) { - InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} Added: cpp-commons/trunk/src/test/test.h =================================================================== --- cpp-commons/trunk/src/test/test.h (rev 0) +++ cpp-commons/trunk/src/test/test.h 2009-03-07 21:15:20 UTC (rev 1266) @@ -0,0 +1,14 @@ +#ifndef COMMONS_TEST_H +#define COMMONS_TEST_H + +#include <gtest/gtest.h> +#define foreach BOOST_FOREACH +using namespace commons; +using namespace testing; + +int main(int argc, char **argv) { + InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |