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-21 17:37:12 +0530
commitffc8138ba026b6ce0471105ab431f054f24589ff (patch)
tree461457075883716916f2649fdfc0533c36586e90 /test/DOMTSHandler.pm
parent2eebfe9785e83b882dfac17c037bfd490cb0bb6a (diff)
downloadlibdom-ffc8138ba026b6ce0471105ab431f054f24589ff.tar.gz
libdom-ffc8138ba026b6ce0471105ab431f054f24589ff.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__