Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4820364
testLibXml2.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 24, 7:13 AM
Size
748 B
Mime Type
text/x-c++
Expires
Wed, Aug 26, 7:13 AM (1 d, 3 h)
Engine
blob
Format
Raw Data
Handle
286456
Attached To
rXR Xreate
testLibXml2.cpp
View Options
//
// Created by pgess on 3/28/15.
//
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <gtest/gtest.h>
using namespace std;
TEST(libxml2, ReadXML)
{
char* docname = "project/documentation.fodt";
xmlDocPtr doc;
xmlNodePtr cur;
doc = xmlParseFile(docname);
if (doc == NULL ) {
fprintf(stderr,"Document not parsed successfully. \n");
return;
}
cur = xmlDocGetRootElement(doc);
if (cur == NULL) {
fprintf(stderr,"empty document\n");
xmlFreeDoc(doc);
return;
}
cur = cur->xmlChildrenNode;
int count =0;
while (cur != NULL) {
printf("child: %s\n", cur->name);
cur = cur->next;
count ++;
}
ASSERT_EQ(17, count);
}
Event Timeline
Log In to Comment