summaryrefslogtreecommitdiff
path: root/test/network_tests/application_tests/application_test_availability.cpp
diff options
context:
space:
mode:
authorDiogo Pedrosa <48529452+DiogoPedrozza@users.noreply.github.com>2023-03-13 14:09:12 +0000
committerGitHub <noreply@github.com>2023-03-13 14:09:12 +0000
commit1b427801352b5dcfdc2277f6343166c01afe97d6 (patch)
treed4e984dd100f3257ce784c9e30aefb6e60a93ab5 /test/network_tests/application_tests/application_test_availability.cpp
parentfc73f40fa1501dc53210c63cb7c0d7623d106370 (diff)
parent826ebb8d352245a36ecaec32b6af61e7abf4696e (diff)
downloadvSomeIP-1b427801352b5dcfdc2277f6343166c01afe97d6.tar.gz
Merge pull request #416 from COVESA/update_3.3.03.3.0
vsomeip 3.3.0
Diffstat (limited to 'test/network_tests/application_tests/application_test_availability.cpp')
-rw-r--r--test/network_tests/application_tests/application_test_availability.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/network_tests/application_tests/application_test_availability.cpp b/test/network_tests/application_tests/application_test_availability.cpp
new file mode 100644
index 0000000..89d94c1
--- /dev/null
+++ b/test/network_tests/application_tests/application_test_availability.cpp
@@ -0,0 +1,39 @@
+// Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#include <gtest/gtest.h>
+
+#include "application_test_client_availability.cpp"
+#include "application_test_service.cpp"
+#include "application_test_daemon.cpp"
+
+TEST(someip_application_test_availability, register_availability_handlers)
+{
+ // start application acting as daemon
+ application_test_daemon its_daemon;
+
+ // start receiver service
+ application_test_service its_receiver(application_test::service);
+
+ // start client
+ application_test_client_availability its_client(application_test::service);
+ int counter(0);
+ while (!its_client.all_availability_handlers_called() && counter < 500) {
+ std::this_thread::sleep_for(std::chrono::milliseconds(10));
+ counter++;
+ }
+
+ //shutdown
+ its_receiver.stop();
+ its_client.stop();
+ its_daemon.stop();
+}
+
+#if defined(__linux__) || defined(ANDROID)
+int main(int argc, char** argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+#endif