???????????cppunit??????????
???????????? ???????[ 2016/1/19 13:34:43 ] ??????????????? ???????
????????????У??????????????д?????????д??????д??????????????????н??в??????????????????????????δ????????????????????????????????????????????????????д?????????????????????????????????????α???У?????????github??С??????????????????????Щ??????????д????????
???????????robot???е?solver??https://github.com/TeamWork-Robot/Team1/tree/master/Robot???????solver?????????????1.robot????δ??????????????????????????void??2.?????point??frame???????????ò???????solver???????????????????????????????????point??
??????д??solver????????????????????????ó???????н????????????solver??????в????????????????????????????Σ???д????????point???????????????????
1 #include <cppunit/extensions/HelperMacros.h>
2 #include <Point.h>
3
4 class testpoint :public CppUnit::TestFixture
5 {
6 CPPUNIT_TEST_SUITE(testpoint);
7 CPPUNIT_TEST(testget);
8 //CPPUNIT_TEST(testrotate);
9 CPPUNIT_TEST_SUITE_END();
10 public:
11 void setUp();
12 void tearDown();
13 testpoint();
14 //~testsolver();
15 void testget();
16 //void testrotate();
17 };
1 #include "test_point.h"
2 #include "Point.h"
3 #include <string>
4 #include<iostream>
5 #include <cppunit/TestCase.h>
6 #include "cppunit/TestAssert.h"
7
8 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(testpoint?? "alltest");
9
10 testpoint::testpoint()
11 {
12 };
13
14 void testpoint::setUp()
15 {
16 std::cout << "test begin" << std::endl;
17 };
18
19 void testpoint::tearDown()
20 {
21 std::cout << "test end" << std::endl;
22 };
23
24 void testpoint::testget()
25 {
26 Point point1(3?? 4);
27 int resultx = point1.getX();
28 int resulty = point1.getY();
29 CPPUNIT_ASSERT(resultx == 3);
30 CPPUNIT_ASSERT(resulty == 4);
31 }
1 #include <cppunit/TestResultCollector.h>
2 #include <cppunit/BriefTestProgressListener.h>
3 #include <cppunit/TextOutputter.h>
4
5 int main()
6 {
7 CppUnit::TestResult r;
8 CppUnit::TestResultCollector rc;
9 r.addListener(&rc); // ????y???????
10
11 CppUnit::TestRunner runner; // ??????????
12 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("alltest").makeTest());
13 runner.run(r); // ???в???
14
15 CppUnit::TextOutputter o(&rc?? std::cout);
16 o.write(); // ????????
17
18 system("pause");
19
20 return rc.wasSuccessful() ? 0 : -1;
21 }
??????point?????????????????????????£???????system("pause");??
??????Point.cpp?е?get??????????????????????????£?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11