-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathunitest.cpp
67 lines (59 loc) · 1.59 KB
/
unitest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "config.hpp"
#include "libai_core.hpp"
#include <stdlib.h>
#include <time.h>
using namespace ucloud;
// using namespace cv;
using ucloud::VecObjBBox;
using ucloud::BatchBBoxIN;
using ucloud::BBox;
using ucloud::TvaiRect;
using std::vector;
/////////////////////////////////////////////////////////////////////////////////////
// HEADER
/////////////////////////////////////////////////////////////////////////////////////
class A{
public:
A(){printf("A construct\n");}
virtual ~A(){printf("A deconstruct\n");}
virtual void init(){
printf("A::init()\n");
func();
return;
}
virtual void print(){
printf("A::print %s\n", m_x.c_str());
}
protected:
virtual void func(){
printf("A::func(), %s\n", m_x.c_str());
return;
}
private:
std::string m_x = "a";
};
class B: public A{
public:
B(){printf("B construct\n");}
virtual ~B(){printf("B deconstruct\n");}
protected:
virtual void func(){
printf("B::func(), %s\n", m_x.c_str());
return;
}
private:
std::string m_x = "b";
};
/////////////////////////////////////////////////////////////////////////////////////
// MAIN
/////////////////////////////////////////////////////////////////////////////////////
int main(int argc, char* argv[]) {
A* ptr = new B();
ptr->init();
ptr->print();
delete ptr;
printf("\033[31mThis text is red\033[0m\n");
}
/////////////////////////////////////////////////////////////////////////////////////
// IMP
/////////////////////////////////////////////////////////////////////////////////////