xalan-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anh Tu ...@plania.no>
Subject C++ unit test framework in Visual Studio fails to set up
Date Thu, 05 Dec 2013 11:15:01 GMT
Hi all,

I am having problem making my C++ unit tests in MSVS 2013 to work on code 
using Xalan library. I was able to compile the library and integrate it in 
my Visual Studio solution. AllInOne, XalanMsgLib and MsgCreator projects are 
part of the VS solution. 
But when trying to run unit tests in Test Explorer, I have the error: 
"Failed to set up the execution context to run the test". 

Does anyone know why and how to fix this?

Thanks alot!
Anh Tu


Code snippet:XmlTransformer.cpp

XALAN_USING_XERCES(XMLPlatformUtils)
XALAN_USING_XALAN(XalanTransformer)
XALAN_USING_XALAN(XSLTInputSource)
XALAN_USING_XALAN(XSLTResultTarget)
bool XmlTransformer::InitXalan()
{
    bool success = true;

        XMLPlatformUtils::Initialize();
        XalanTransformer::initialize();

        XalanTransformer xalanTransformer;

        // Example of explicit instantiation.
        XSLTInputSource xmlIn("foo.xml");
        XSLTInputSource xslIn("foo.xsl");
        XSLTResultTarget xmlOut("foo-out.xml");
        int explicitResult =
            xalanTransformer.transform(xmlIn, xslIn, xmlOut);

   return success;
}


Unit test code: XmlParserExampleTest.cpp
    TEST_CLASS(XmlParserTest)
    {
    public:

        TEST_METHOD(CreateXmlParser)
        {
            XmlParser* xmlParserInstance = new XmlParser();
            Assert::IsNotNull(xmlParserInstance, L"Unable to create instance 
of XmlParser.", LINE_INFO());
        }
    };




Mime
View raw message