Add skeletons of db related codes
authorJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 8 Jan 2021 08:08:19 +0000 (17:08 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 8 Jan 2021 08:26:18 +0000 (17:26 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/rpk/rpk_registration.cc [new file with mode: 0644]
src/rpk/rpk_registration.h [new file with mode: 0644]
test/unit_tests/test_rpk_registration.cc [new file with mode: 0644]

diff --git a/src/rpk/rpk_registration.cc b/src/rpk/rpk_registration.cc
new file mode 100644 (file)
index 0000000..d0395dc
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "rpk/rpk_registration.h"
+
+#include <pkgmgr_parser_db.h>
+
+#include <string>
+
+namespace rpk {
+
+bool RegisterRpkInfo(manifest_x* manifest, uid_t uid) {
+  return true;
+}
+bool UpdateRpkInfo(manifest_x* manifest, uid_t uid) {
+  return true;
+}
+bool UnregisterRpkInfo(const std::string& pkgid, uid_t uid) {
+  return true;
+}
+
+}  // namespace rpk
diff --git a/src/rpk/rpk_registration.h b/src/rpk/rpk_registration.h
new file mode 100644 (file)
index 0000000..2aed39b
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef RPK_RPK_REGISTRATION_H_
+#define RPK_RPK_REGISTRATION_H_
+
+#include <pkgmgr-info.h>
+#include <pkgmgr_parser_db.h>
+
+#include <string>
+
+namespace rpk {
+
+bool RegisterRpkInfo(manifest_x* manifest, uid_t uid);
+
+bool UpdateRpkInfo(manifest_x* manifest, uid_t uid);
+
+bool UnregisterRpkInfo(const std::string& pkgid, uid_t uid);
+
+}  // namespace rpk
+
+#endif  // RPK_RPK_REGISTRATION_H_
diff --git a/test/unit_tests/test_rpk_registration.cc b/test/unit_tests/test_rpk_registration.cc
new file mode 100644 (file)
index 0000000..be47bad
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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 <gtest/gtest.h>
+
+#include "rpk/rpk_registration.h"
+
+class RpkRegistrationTest : public ::testing::Test {
+ public:
+  virtual void SetUp() {
+  }
+
+  virtual void TearDown() {
+  }
+};
+
+TEST_F(RpkRegistrationTest, DummyTest) {
+  EXPECT_EQ(rpk::RegisterRpkInfo(nullptr, 0), true);
+}