Change-Id: Id7a36a8f2f7ac5079c731ce8fb46ae5d7e2529b1
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
Bundle& operator = (Bundle&& b) noexcept;
/**
+ * @brief Check the bundle is empty or not.
+ * @since_tizen 6.0
+ * @return true if the bundle is empty
+ */
+ bool IsEmpty() const noexcept;
+
+ /**
* @brief Gets keys in bundle object.
* @since_tizen 5.5
* @return A string array of object KeyInfo
return *this;
}
+bool Bundle::IsEmpty() const noexcept {
+ return (bundle_get_count(impl_->handle_) == 0) ? true : false;
+}
+
std::vector<Bundle::KeyInfo> Bundle::GetKeys() {
std::vector<Bundle::KeyInfo> v;
EXPECT_EQ(copied.GetName(), name);
}
}
+
+TEST(Bundle, IsEmpty) {
+ Bundle bundle;
+ EXPECT_TRUE(bundle.IsEmpty());
+ bundle.Add("TestKey1", "TestVal");
+ EXPECT_FALSE(bundle.IsEmpty());
+}