diff --git a/tests/DOM/conformance/level1/core/attrnotspecifiedvalue.hpp b/tests/DOM/conformance/level1/core/attrnotspecifiedvalue.hpp index 02618c25..3c68c15c 100644 --- a/tests/DOM/conformance/level1/core/attrnotspecifiedvalue.hpp +++ b/tests/DOM/conformance/level1/core/attrnotspecifiedvalue.hpp @@ -1,106 +1,106 @@ -#ifndef test_attrnotspecifiedvalue -#define test_attrnotspecifiedvalue - - -/* -This C++ source file was generated for Arabica -from the source document contained in the W3C -DOM Conformance Test Suite. -The source document contained the following notice: - - -Copyright (c) 2001-2004 World Wide Web Consortium, -(Massachusetts Institute of Technology, Institut National de -Recherche en Informatique et en Automatique, Keio University). All -Rights Reserved. This program is distributed under the W3C's Software -Intellectual Property License. This program is distributed in the -hope that it will be useful, but WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. -See W3C License http://www.w3.org/Consortium/Legal/ for more details. - -*/ -/** - * The "getSpecified()" method for an Attr node should - * be set to false if the attribute was not explicitly given - * a value. - * Retrieve the attribute named "street" from the last - * child of of the first employee and examine the value - * returned by the "getSpecified()" method. This test uses - * the "getNamedItem(name)" method from the NamedNodeMap - * interface. -* @author NIST -* @author Mary Brady -* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 -* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html -*/ - -template -class attrnotspecifiedvalue : public DOMTestCase -{ - typedef DOMTestCase baseT; - public: - attrnotspecifiedvalue(std::string name) : baseT(name) - { - - // check if loaded documents are supported for content type - const std::string contentType = baseT::getContentType(); - baseT::preload(contentType, "staff", false); - } - - typedef typename Arabica::DOM::DOMImplementation DOMImplementation; - typedef typename Arabica::DOM::Document Document; - typedef typename Arabica::DOM::DocumentType DocumentType; - typedef typename Arabica::DOM::DocumentFragment DocumentFragment; - typedef typename Arabica::DOM::Node Node; - typedef typename Arabica::DOM::Element Element; - typedef typename Arabica::DOM::Attr Attr; - typedef typename Arabica::DOM::NodeList NodeList; - typedef typename Arabica::DOM::NamedNodeMap NamedNodeMap; - typedef typename Arabica::DOM::Entity Entity; - typedef typename Arabica::DOM::EntityReference EntityReference; - typedef typename Arabica::DOM::CharacterData CharacterData; - typedef typename Arabica::DOM::CDATASection CDATASection; - typedef typename Arabica::DOM::Text Text; - typedef typename Arabica::DOM::Comment Comment; - typedef typename Arabica::DOM::ProcessingInstruction ProcessingInstruction; - typedef typename Arabica::DOM::Notation Notation; - - typedef typename Arabica::DOM::DOMException DOMException; - typedef string_type String; - typedef string_adaptor SA; - typedef bool boolean; - - - /* - * Runs the test case. - */ - void runTest() - { - Document doc; - NodeList addressList; - Node testNode; - NamedNodeMap attributes; - Attr streetAttr; - boolean state; - doc = (Document) baseT::load("staff", false); - addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); - testNode = addressList.item(0); - attributes = testNode.getAttributes(); - streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); - baseT::skipIfNull(streetAttr); - state = streetAttr.getSpecified(); - assertFalse(state); - - } - - /* - * Gets URI that identifies the test. - */ - std::string getTargetURI() const - { - return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrnotspecifiedvalue"; - } -}; - -#endif +#ifndef test_attrnotspecifiedvalue +#define test_attrnotspecifiedvalue + + +/* +This C++ source file was generated for Arabica +from the source document contained in the W3C +DOM Conformance Test Suite. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ +/** + * The "getSpecified()" method for an Attr node should + * be set to false if the attribute was not explicitly given + * a value. + * Retrieve the attribute named "street" from the last + * child of of the first employee and examine the value + * returned by the "getSpecified()" method. This test uses + * the "getNamedItem(name)" method from the NamedNodeMap + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class attrnotspecifiedvalue : public DOMTestCase +{ + typedef DOMTestCase baseT; + public: + attrnotspecifiedvalue(std::string name) : baseT(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = baseT::getContentType(); + baseT::preload(contentType, "staff", false); + } + + typedef typename Arabica::DOM::DOMImplementation DOMImplementation; + typedef typename Arabica::DOM::Document Document; + typedef typename Arabica::DOM::DocumentType DocumentType; + typedef typename Arabica::DOM::DocumentFragment DocumentFragment; + typedef typename Arabica::DOM::Node Node; + typedef typename Arabica::DOM::Element Element; + typedef typename Arabica::DOM::Attr Attr; + typedef typename Arabica::DOM::NodeList NodeList; + typedef typename Arabica::DOM::NamedNodeMap NamedNodeMap; + typedef typename Arabica::DOM::Entity Entity; + typedef typename Arabica::DOM::EntityReference EntityReference; + typedef typename Arabica::DOM::CharacterData CharacterData; + typedef typename Arabica::DOM::CDATASection CDATASection; + typedef typename Arabica::DOM::Text Text; + typedef typename Arabica::DOM::Comment Comment; + typedef typename Arabica::DOM::ProcessingInstruction ProcessingInstruction; + typedef typename Arabica::DOM::Notation Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + boolean state; + doc = (Document) baseT::load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + baseT::skipIfNull(streetAttr); + state = streetAttr.getSpecified(); + if(state) + throw SkipException("Minor conformance fail - Attr.getSpecified() should be false when attribute value is supplied implicitly by the DTD"); + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrnotspecifiedvalue"; + } +}; + +#endif