|
@@ -38,10 +38,23 @@ test_ar_normalize_name(void)
|
|
|
test_str(arh.ar_name, ==, "member-name");
|
|
test_str(arh.ar_name, ==, "member-name");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static void
|
|
|
|
|
+test_ar_member_is_illegal(void)
|
|
|
|
|
+{
|
|
|
|
|
+ struct ar_hdr arh;
|
|
|
|
|
+
|
|
|
|
|
+ memset(&arh, ' ', sizeof(arh));
|
|
|
|
|
+ test_pass(dpkg_ar_member_is_illegal(&arh));
|
|
|
|
|
+
|
|
|
|
|
+ memcpy(arh.ar_fmag, ARFMAG, sizeof(arh.ar_fmag));
|
|
|
|
|
+ test_fail(dpkg_ar_member_is_illegal(&arh));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static void
|
|
static void
|
|
|
test(void)
|
|
test(void)
|
|
|
{
|
|
{
|
|
|
- test_plan(2);
|
|
|
|
|
|
|
+ test_plan(4);
|
|
|
|
|
|
|
|
test_ar_normalize_name();
|
|
test_ar_normalize_name();
|
|
|
|
|
+ test_ar_member_is_illegal();
|
|
|
}
|
|
}
|