-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
83 lines (58 loc) · 2.14 KB
/
main.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* main.cpp
*
* Created on: Dec 16, 2013
* Author: kazu
*/
#include "test/Test.h"
#include "net/http/HttpServer.h"
#include "net/http/HttpServerListener.h"
#include "net/http/HttpServerRequestHandler.h"
#include "streams/ByteArrayInputStream.h"
class MyListener : public K::HttpServerListener {
void onHttpRequest(K::HttpServerRequestHandler* handler, K::HttpRequest& req, K::InputStream& is) {
K::HttpResponse resp;
resp.setCode(200);
resp.setVersion(K::HttpVersion::HTTP_1_1);
resp.getHeader().add("connection", "close");
resp.getHeader().add("content-type", "text-html");
resp.getHeader().add("content-length", "4");
std::string str = "miau";
K::ByteArrayInputStream bais( (uint8_t*) str.data(), str.length());
handler->respond(resp, &bais);
}
};
int main(int argc, char** argv) {
// K::HttpServer srv(8080);
// srv.setListener(new MyListener());w
// srv.start();
// sleep(100);
// srv.stop(); const double heading = 0;
const double heading2 = 90;
// const double h1Rad = (heading / 180 * M_PI);
// const double h2Rad = (heading2 / 180 * M_PI);
// const double diffRad = std::fmod(((h1Rad-h2Rad) + M_PI), 2*M_PI) - M_PI;
#ifdef WITH_TESTS
//::testing::GTEST_FLAG(filter) = "*LensCalibration*";
//::testing::GTEST_FLAG(filter) = "*KDTree*";
//::testing::GTEST_FLAG(filter) = "*OCR*";
//::testing::GTEST_FLAG(filter) = "*Circle3*";
//::testing::GTEST_FLAG(filter) = "*Plane3*";
//::testing::GTEST_FLAG(filter) = "*NumericalOptimizationAlgo*";
//::testing::GTEST_FLAG(filter) = "*BravaisPearson*";
//::testing::GTEST_FLAG(filter) = "*Distribution.normalN*";
//::testing::GTEST_FLAG(filter) = "HHOG2*";
//::testing::GTEST_FLAG(filter) = "GeneticLinearTransformN*";
::testing::GTEST_FLAG(filter) = "NumericalOptimizationPSO*";
//::testing::GTEST_FLAG(filter) = "*BBox2*";
//::testing::GTEST_FLAG(filter) = "*Ellipse*";
//::testing::GTEST_FLAG(filter) = "*Ellipses*";
//::testing::GTEST_FLAG(filter) = "*FundamentalMatrix*";
//::testing::GTEST_FLAG(filter) = "*Distribution*";
//::testing::GTEST_FLAG(filter) = "*Vector*";
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
#else
return 0;
#endif
}