2 * Copyright 2020 AT&T Intellectual Property
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 // Created by adi ENZEL on 2/10/20.
23 #include <cgreen/cgreen.h>
25 //#include "sctpClient.cpp"
35 using namespace cgreen;
39 Ensure(Cgreen, createEpoll) {
40 epoll_fd = createEpoll();
41 assert_that(epoll_fd != -1);
42 assert_that(epoll_fd > 0);
47 Ensure(Cgreen, createConnectionIpV6) {
48 auto epoll_fd = createEpoll();
49 assert_that(epoll_fd != -1);
50 assert_that(epoll_fd > 0);
51 unsigned num_cpus = std::thread::hardware_concurrency();
52 std::vector<std::thread> threads(num_cpus);
55 // threads[i] = std::thread(listener, &epoll_fd);
57 // auto fd = createSctpConnction("::1", port, epoll_fd);
58 // assert_that(fd != -1);
59 // assert_that(fd == 0);
65 Ensure(Cgreen, createConnectionIpV4) {
66 auto epoll_fd = createEpoll();
67 assert_that(epoll_fd != -1);
68 assert_that(epoll_fd > 0);
69 unsigned num_cpus = std::thread::hardware_concurrency();
70 std::vector<std::thread> threads(num_cpus);
73 // threads[i] = std::thread(listener, &epoll_fd);
75 // auto fd = createSctpConnction("127.0.0.1", port, epoll_fd);
76 // assert_that(fd != -1);
77 // assert_that(fd == 0);
84 //int main(const int argc, char **argv) {
85 // TestSuite *suite = create_named_test_suite_(__FUNCTION__, __FILE__, __LINE__);
87 // add_test_with_context(suite, Cgreen, createEpoll);
88 // //add_test_with_context(suite, Cgreen, createConnectionIpV6);
89 // add_test_with_context(suite, Cgreen, createConnectionIpV4);
90 // return cgreen::run_test_suite(suite, create_text_reporter());