summaryrefslogtreecommitdiff
path: root/tests/TransportModuleLoader_test.cc
diff options
context:
space:
mode:
authorJihoon Jung <jh8801.jung@samsung.com>2022-08-09 09:07:09 +0900
committerJihoon Jung <jh8801.jung@samsung.com>2022-08-09 09:08:16 +0900
commit1b6f4c7841f9b4c14772f5acf81409f35403b9b7 (patch)
treed216e4b8efbddc3d1f52bc541a9a2706a80d65da /tests/TransportModuleLoader_test.cc
parent38d3e3904884b6b6959726cb21e407b357a96fb5 (diff)
downloadaitt-master.tar.gz
aitt-master.tar.bz2
aitt-master.zip
Change-Id: I7e19c06adf39f36e326f32e11ef00932a3dbfaa5
Diffstat (limited to 'tests/TransportModuleLoader_test.cc')
-rw-r--r--tests/TransportModuleLoader_test.cc49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/TransportModuleLoader_test.cc b/tests/TransportModuleLoader_test.cc
new file mode 100644
index 0000000..57e69b1
--- /dev/null
+++ b/tests/TransportModuleLoader_test.cc
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "TransportModuleLoader.h"
+
+#include <AITT.h>
+#include <gtest/gtest.h>
+
+#include "AittTransport.h"
+#include "aitt_internal.h"
+
+class TransportModuleLoaderTest : public testing::Test {
+ public:
+ TransportModuleLoaderTest(void) : discovery("test"), loader("127.0.0.1")
+ {
+ loader.Init(discovery);
+ }
+
+ protected:
+ void SetUp() override {}
+ void TearDown() override {}
+
+ aitt::AittDiscovery discovery;
+ aitt::TransportModuleLoader loader;
+};
+
+TEST_F(TransportModuleLoaderTest, Positive_GetInstance_Anytime)
+{
+ std::shared_ptr<aitt::AittTransport> module = loader.GetInstance(AITT_TYPE_TCP);
+ ASSERT_NE(module, nullptr);
+}
+
+TEST_F(TransportModuleLoaderTest, Negative_GetInstance_Anytime)
+{
+ std::shared_ptr<aitt::AittTransport> module = loader.GetInstance(AITT_TYPE_MQTT);
+ ASSERT_EQ(module, nullptr);
+}