1 // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
2 // This Source Code Form is subject to the terms of the Mozilla Public
3 // License, v. 2.0. If a copy of the MPL was not distributed with this
4 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 #include <gtest/gtest.h>
6 
7 #include "application_test_client_availability.cpp"
8 #include "application_test_service.cpp"
9 #include "application_test_daemon.cpp"
10 
TEST(someip_application_test_availability,register_availability_handlers)11 TEST(someip_application_test_availability, register_availability_handlers)
12 {
13     // start application acting as daemon
14     application_test_daemon its_daemon;
15 
16     // start receiver service
17     application_test_service its_receiver(application_test::service);
18 
19     // start client
20     application_test_client_availability its_client(application_test::service);
21     int counter(0);
22     while (!its_client.all_availability_handlers_called() && counter < 500) {
23         std::this_thread::sleep_for(std::chrono::milliseconds(10));
24         counter++;
25     }
26 
27     //shutdown
28     its_receiver.stop();
29     its_client.stop();
30     its_daemon.stop();
31 }
32 
33 #ifndef _WIN32
main(int argc,char ** argv)34 int main(int argc, char** argv)
35 {
36     ::testing::InitGoogleTest(&argc, argv);
37     return RUN_ALL_TESTS();
38 }
39 #endif
40