瀏覽代碼

libdpkg: Add test cases for eflags manipulators

Guillem Jover 14 年之前
父節點
當前提交
cba43c1251
共有 1 個文件被更改,包括 21 次插入0 次删除
  1. 21 0
      lib/dpkg/test/t-pkginfo.c

+ 21 - 0
lib/dpkg/test/t-pkginfo.c

@@ -43,6 +43,26 @@ test_pkginfo_informative(void)
 	/* FIXME: Complete. */
 }
 
+static void
+test_pkginfo_eflags(void)
+{
+	struct pkginfo pkg;
+
+	pkg_blank(&pkg);
+	test_pass(pkg.eflag == eflag_ok);
+
+	pkg_set_eflags(&pkg, eflag_reinstreq);
+	test_pass(pkg.eflag == eflag_reinstreq);
+
+	pkg_clear_eflags(&pkg, eflag_reinstreq);
+	test_pass(pkg.eflag == eflag_ok);
+
+	pkg_set_eflags(&pkg, 0x11);
+	test_pass(pkg.eflag == 0x11);
+	pkg_reset_eflags(&pkg);
+	test_pass(pkg.eflag == eflag_ok);
+}
+
 static void
 test_pkginfo_instance_tracking(void)
 {
@@ -125,6 +145,7 @@ static void
 test(void)
 {
 	test_pkginfo_informative();
+	test_pkginfo_eflags();
 	test_pkginfo_instance_tracking();
 
 	/* FIXME: Complete. */