mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-08-05 23:35:48 +03:00
Improve testThreads a bit
* xsltproc/testThreads.c: load exslt extensions, the test module and a bit of output
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "libexslt/exslt.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
#include <libxslt/transform.h>
|
#include <libxslt/transform.h>
|
||||||
#include <libxslt/xsltutils.h>
|
#include <libxslt/xsltutils.h>
|
||||||
#include <libxslt/extensions.h>
|
#include <libxslt/extensions.h>
|
||||||
|
#include <libexslt/exsltconfig.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
@@ -179,12 +181,22 @@ main(void)
|
|||||||
|
|
||||||
xmlInitParser();
|
xmlInitParser();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Register the EXSLT extensions and the test module
|
||||||
|
*/
|
||||||
|
exsltRegisterAll();
|
||||||
|
xsltRegisterTestModule();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Register our own extension module
|
||||||
|
*/
|
||||||
registerFooModule();
|
registerFooModule();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First pass each thread has its own version of the stylesheet
|
* First pass each thread has its own version of the stylesheet
|
||||||
* each of them will initialize and shutdown the extension
|
* each of them will initialize and shutdown the extension
|
||||||
*/
|
*/
|
||||||
|
printf("Pass 1\n");
|
||||||
for (repeat = 0;repeat < 500;repeat++) {
|
for (repeat = 0;repeat < 500;repeat++) {
|
||||||
for (i = 0; i < num_threads; i++) {
|
for (i = 0; i < num_threads; i++) {
|
||||||
results[i] = NULL;
|
results[i] = NULL;
|
||||||
@@ -212,6 +224,7 @@ main(void)
|
|||||||
* Second pass all threads share the same stylesheet instance
|
* Second pass all threads share the same stylesheet instance
|
||||||
* look for transformation clashes
|
* look for transformation clashes
|
||||||
*/
|
*/
|
||||||
|
printf("Pass 2\n");
|
||||||
for (repeat = 0;repeat < 500;repeat++) {
|
for (repeat = 0;repeat < 500;repeat++) {
|
||||||
xmlDocPtr style;
|
xmlDocPtr style;
|
||||||
xsltStylesheetPtr cur;
|
xsltStylesheetPtr cur;
|
||||||
@@ -251,6 +264,7 @@ main(void)
|
|||||||
xsltCleanupGlobals();
|
xsltCleanupGlobals();
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
xmlMemoryDump();
|
xmlMemoryDump();
|
||||||
|
printf("Ok\n");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
#else /* !LIBXML_THREADS_ENABLED | !HAVE_PTHREAD_H */
|
#else /* !LIBXML_THREADS_ENABLED | !HAVE_PTHREAD_H */
|
||||||
|
Reference in New Issue
Block a user