On Thu, Dec 05, 2013 at 07:33:38PM -0800, Seth Arnold wrote:
> On Tue, Dec 03, 2013 at 12:12:20PM -0800, Steve Beattie wrote:
> > Signed-off-by: Steve Beattie <[email protected]>
> 
> Acked-by: Seth Arnold <[email protected]>

Thanks.

> I think one more case would be useful, to check that /**/ works as
> expected:
> 
>       MY_REGEX_TEST("/**/", "/[^/\\x00][^\\x00]*/", ePatternTailGlob);
> 
> Does that look right?

Correct except for the type returned, which will be ePatternRegex if I'm
not mistaken.

And, I think tests for both /*/ and /**/ would be useful. So here's a
patch:

Signed-off-by: Steve Beattie <[email protected]>
---
 parser/parser_regex.c |    2 ++
 1 file changed, 2 insertions(+)

Index: b/parser/parser_regex.c
===================================================================
--- a/parser/parser_regex.c
+++ b/parser/parser_regex.c
@@ -1390,9 +1390,11 @@ static int test_aaregex_to_pcre(void)
        MY_REGEX_TEST("/*", "/[^/\\x00][^/\\x00]*", ePatternRegex);
        MY_REGEX_TEST("/blort/*", "/blort/[^/\\x00][^/\\x00]*", ePatternRegex);
        MY_REGEX_TEST("/*/blort", "/[^/\\x00][^/\\x00]*/blort", ePatternRegex);
+       MY_REGEX_TEST("/*/", "/[^/\\x00][^/\\x00]*/", ePatternRegex);
        MY_REGEX_TEST("/**", "/[^/\\x00][^\\x00]*", ePatternTailGlob);
        MY_REGEX_TEST("/blort/**", "/blort/[^/\\x00][^\\x00]*", 
ePatternTailGlob);
        MY_REGEX_TEST("/**/blort", "/[^/\\x00][^\\x00]*/blort", ePatternRegex);
+       MY_REGEX_TEST("/**/", "/[^/\\x00][^\\x00]*/", ePatternRegex);
 
        /* more complicated quoting */
        MY_REGEX_FAIL_TEST("\\\\[");

-- 
Steve Beattie
<[email protected]>
http://NxNW.org/~steve/

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to