/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to validate/tools.h

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-23 17:13:04 UTC
  • Revision ID: csa@dside.dyndns.org-20090923171304-osvtr4zqb29h11kd
Intel, Tango, Phobos, and RapidXML parsers; Memory benchmark scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
    struct TestData td;
79
79
    char *xmlbuf,*xsdbuf;
80
80
 
 
81
    int parse_xml = 1;
 
82
    int validate_xml = 1;
 
83
    
 
84
    if (getenv("skip_validate")) {
 
85
        validate_xml = 0;
 
86
        if (getenv("skip_xml")) parse_xml = 0;
 
87
    }
 
88
 
81
89
    if (argc!=4) Usage(argv[0]);
82
90
 
83
91
    td.iterations = atol(argv[1]);
84
 
    if (td.iterations<=0) Usage(argv[0]);
 
92
    if (td.iterations<0) Usage(argv[0]);
85
93
    
86
94
    if (!strncmp(argv[2],"xmlgen",6)) mode=1;
87
95
    else if (!strncmp(argv[2],"opcgen",6)) mode=2;
142
150
 
143
151
    
144
152
    initXML(&td);
145
 
    parseXML(&td,0);
 
153
    if (parse_xml) parseXML(&td,0);
146
154
 
147
155
    gettimeofday(&pre_time,NULL);
148
156
    initXML_Validation(&td);
150
158
    init_time=(post_time.tv_sec-pre_time.tv_sec)*1000000+(post_time.tv_usec-pre_time.tv_usec);
151
159
 
152
160
    gettimeofday(&pre_time,NULL);
153
 
    validateXML(&td,0);
 
161
    if (validate_xml) validateXML(&td,0);
154
162
    gettimeofday(&post_time,NULL);
155
163
    init_time2=(post_time.tv_sec-pre_time.tv_sec)*1000000+(post_time.tv_usec-pre_time.tv_usec);
156
164
    
164
172
                td.xmllen=opcgen();
165
173
            break;
166
174
        }
167
 
        parseXML(&td,i);
 
175
        if (parse_xml) parseXML(&td,i);
168
176
        gettimeofday(&pre_time,NULL);
169
 
        validateXML(&td,i);
 
177
        if (validate_xml) validateXML(&td,i);
170
178
        gettimeofday(&post_time,NULL);
171
179
        time=(post_time.tv_sec-pre_time.tv_sec)*1000000+(post_time.tv_usec-pre_time.tv_usec);
172
180
        disp_event(time);