~ubuntu-branches/ubuntu/quantal/dovecot/quantal

« back to all changes in this revision

Viewing changes to sieve/src/testsuite/tst-test-script-compile.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-29 09:21:32 UTC
  • mfrom: (4.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20100629092132-q4pr5lfuvmjqou19
Tags: 1:1.2.12-1ubuntu1
* Merge from Debian Unstable, remaining changes:
  + Add mail-stack-delivery as per server-maverick-mail-integration spec:
   - Update debian/rules
   - Convert existing package to a dummy package and add new binary in debian/control
   - Update maintainer scripts.
   - Move previously installed backups and config files to new package name
     space in preinst
   - Add new debian/mail-stack-delivery.prerm to handle downgrades
   - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*
  + Use Snakeoil SSL certificates by default.
    - debian/control: Depend on ssl-cert.
    - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert paths to snakeoil.
    - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - Created debian/dovecot-common.ufw.profile.
    - debian/rules: install profile.
    - debian/control: suggest ufw.
  + debian/{control,rules}: enable PIE hardening.
  + debian/control: Update Vcs-* headers.
  + Add SMTP-AUTH support for Outlook (login auth mechanism) 
  + debian/dovecot-common.dirs: Added usr/share/doc/dovecot-common
  + debian/patches/fix-dovecot-config-parser.patch: Fix ordering of external config 
    files. (LP: #597818)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
/*
19
19
 * Test_script_compile command
20
20
 *
21
 
 * Syntax:   
 
21
 * Syntax:
22
22
 *   test_script_compile <scriptpath: string>
23
23
 */
24
24
 
27
27
static bool tst_test_script_compile_generate
28
28
        (const struct sieve_codegen_env *cgenv, struct sieve_command *cmd);
29
29
 
30
 
const struct sieve_command_def tst_test_script_compile = { 
31
 
        "test_script_compile", 
32
 
        SCT_TEST, 
 
30
const struct sieve_command_def tst_test_script_compile = {
 
31
        "test_script_compile",
 
32
        SCT_TEST,
33
33
        1, 0, FALSE, FALSE,
34
34
        NULL, NULL,
35
 
        tst_test_script_compile_validate, 
36
 
        tst_test_script_compile_generate, 
37
 
        NULL 
 
35
        tst_test_script_compile_validate,
 
36
        tst_test_script_compile_generate,
 
37
        NULL
38
38
};
39
39
 
40
 
/* 
41
 
 * Operation 
 
40
/*
 
41
 * Operation
42
42
 */
43
43
 
44
44
static bool tst_test_script_compile_operation_dump
46
46
static int tst_test_script_compile_operation_execute
47
47
        (const struct sieve_runtime_env *renv, sieve_size_t *address);
48
48
 
49
 
const struct sieve_operation_def test_script_compile_operation = { 
 
49
const struct sieve_operation_def test_script_compile_operation = {
50
50
        "TEST_SCRIPT_COMPILE",
51
 
        &testsuite_extension, 
 
51
        &testsuite_extension,
52
52
        TESTSUITE_OPERATION_TEST_SCRIPT_COMPILE,
53
 
        tst_test_script_compile_operation_dump, 
54
 
        tst_test_script_compile_operation_execute 
 
53
        tst_test_script_compile_operation_dump,
 
54
        tst_test_script_compile_operation_execute
55
55
};
56
56
 
57
 
/* 
58
 
 * Validation 
 
57
/*
 
58
 * Validation
59
59
 */
60
60
 
61
61
static bool tst_test_script_compile_validate
62
 
(struct sieve_validator *valdtr ATTR_UNUSED, struct sieve_command *tst) 
 
62
(struct sieve_validator *valdtr ATTR_UNUSED, struct sieve_command *tst)
63
63
{
64
64
        struct sieve_ast_argument *arg = tst->first_positional;
65
 
        
 
65
 
66
66
        if ( !sieve_validate_positional_argument
67
67
                (valdtr, tst, arg, "script", 1, SAAT_STRING) ) {
68
68
                return FALSE;
69
69
        }
70
 
        
 
70
 
71
71
        return sieve_validator_argument_activate(valdtr, tst, arg, FALSE);
72
72
}
73
73
 
74
 
/* 
75
 
 * Code generation 
 
74
/*
 
75
 * Code generation
76
76
 */
77
77
 
78
78
static bool tst_test_script_compile_generate
84
84
        return sieve_generate_arguments(cgenv, tst, NULL);
85
85
}
86
86
 
87
 
/* 
 
87
/*
88
88
 * Code dump
89
89
 */
90
 
 
 
90
 
91
91
static bool tst_test_script_compile_operation_dump
92
92
(const struct sieve_dumptime_env *denv, sieve_size_t *address)
93
93
{
94
94
        sieve_code_dumpf(denv, "TEST_SCRIPT_COMPILE:");
95
95
        sieve_code_descend(denv);
96
96
 
97
 
        if ( !sieve_opr_string_dump(denv, address, "script") ) 
 
97
        if ( !sieve_opr_string_dump(denv, address, "script") )
98
98
                return FALSE;
99
99
 
100
100
        return TRUE;
127
127
        sieve_runtime_trace(renv, "TEST COMPILE: %s", str_c(script_name));
128
128
 
129
129
        script_path = sieve_script_dirpath(renv->script);
130
 
        if ( script_path == NULL ) 
 
130
        if ( script_path == NULL )
131
131
                return SIEVE_EXEC_FAILURE;
132
132
 
133
133
        script_path = t_strconcat(script_path, "/", str_c(script_name), NULL);