summaryrefslogtreecommitdiff
path: root/test/DOMTSHandler.pm
diff options
context:
space:
mode:
authorrsk1994 <rsk1coder99@gmail.com>2014-05-15 05:43:49 +0530
committerRupinder Singh Khokhar <rsk1coder99@gmail.com>2014-06-11 04:27:07 +0530
commit501852e21d843601d2501cfe9cb31a13f259cf50 (patch)
tree64c082f770d6d04d3fb371a66e9f774e4d1a3deb /test/DOMTSHandler.pm
parent72de0d1c1b36201c72ac4881faa0b57b920aac63 (diff)
downloadlibdom-501852e21d843601d2501cfe9cb31a13f259cf50.tar.gz
libdom-501852e21d843601d2501cfe9cb31a13f259cf50.tar.bz2
Typecasting POC to correct DOMTSHandler. A minor dupliction fixed in Anchor Element. Image <img> Element
Diffstat (limited to 'test/DOMTSHandler.pm')
-rw-r--r--test/DOMTSHandler.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/DOMTSHandler.pm b/test/DOMTSHandler.pm
index 645e841..6dfaae9 100644
--- a/test/DOMTSHandler.pm
+++ b/test/DOMTSHandler.pm
@@ -479,21 +479,29 @@ sub generate_load {
my ($self, $a) = @_;
my %ats = %$a;
my $doc = $ats{"var"};
-
$test_index ++;
+ my $var = $self->{"var"};
# define the test file path, use HTML if there is, otherwise using XML
# Attention: I intend to copy the test files to the program excuting dir
print "\tconst char *test$test_index = \"$ats{'href'}.html\";\n\n";
- print "\t$doc = load_html(test$test_index, $ats{'willBeModified'});";
+ if ($var->{$doc} eq "Node") {
+ print "\t$doc = (dom_node*) load_html(test$test_index, $ats{'willBeModified'});";
+ } else {
+ print "\t$doc = load_html(test$test_index, $ats{'willBeModified'});";
+ }
print "\tif ($doc == NULL) {\n";
$test_index ++;
print "\t\tconst char *test$test_index = \"$ats{'href'}.xml\";\n\n";
- print "\t\t$doc = load_xml(test$test_index, $ats{'willBeModified'});\n";
+ if ($var->{$doc} eq "Node") {
+ print "\t\t$doc = (dom_node *) load_xml(test$test_index, $ats{'willBeModified'});\n";
+ } else {
+ print "\t\t$doc = load_xml(test$test_index, $ats{'willBeModified'});\n";
+ }
print "\t\tif ($doc == NULL)\n";
print "\t\t\treturn 1;\n";
print "\t\t}\n";
print << "__EOF__";
- exp = dom_document_get_implementation($doc, &doc_impl);
+ exp = dom_document_get_implementation((dom_document *) $doc, &doc_impl);
if (exp != DOM_NO_ERR)
return exp;
__EOF__