Skip to content

Commit f5acb76

Browse files
author
Abhinav Arora
committed
first commit
0 parents  commit f5acb76

12 files changed

+7346
-0
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Compiled Object files
2+
*.slo
3+
*.lo
4+
*.o
5+
6+
# Compiled Dynamic libraries
7+
*.so
8+
9+
# Compiled Static libraries
10+
*.lai
11+
*.la
12+
*.a
13+
14+
# Folders
15+
bin/
16+
obj/

Model Based Testing.cbp

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_project_file>
3+
<FileVersion major="1" minor="6" />
4+
<Project>
5+
<Option title="Model Based Testing" />
6+
<Option pch_mode="2" />
7+
<Option compiler="gcc" />
8+
<Build>
9+
<Target title="Debug">
10+
<Option output="bin\Debug\Model Based Testing" prefix_auto="1" extension_auto="1" />
11+
<Option object_output="obj\Debug\" />
12+
<Option type="1" />
13+
<Option compiler="gcc" />
14+
<Compiler>
15+
<Add option="-g" />
16+
</Compiler>
17+
</Target>
18+
<Target title="Release">
19+
<Option output="bin\Release\Model Based Testing" prefix_auto="1" extension_auto="1" />
20+
<Option object_output="obj\Release\" />
21+
<Option type="1" />
22+
<Option compiler="gcc" />
23+
<Compiler>
24+
<Add option="-O2" />
25+
</Compiler>
26+
<Linker>
27+
<Add option="-s" />
28+
</Linker>
29+
</Target>
30+
</Build>
31+
<Compiler>
32+
<Add option="-Wall" />
33+
<Add option="-fexceptions" />
34+
</Compiler>
35+
<Unit filename="main.cpp" />
36+
<Unit filename="test.xml" />
37+
<Unit filename="tinystr.cpp" />
38+
<Unit filename="tinystr.h" />
39+
<Unit filename="tinyxml.cpp" />
40+
<Unit filename="tinyxml.h" />
41+
<Unit filename="tinyxmlerror.cpp" />
42+
<Unit filename="tinyxmlparser.cpp" />
43+
<Extensions>
44+
<code_completion />
45+
<debugger />
46+
</Extensions>
47+
</Project>
48+
</CodeBlocks_project_file>

Model Based Testing.depend

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# depslib dependency file v1.0
2+
1334602113 source:c:\users\abhinav\desktop\btp\model based testing\main.cpp
3+
"tinyxml.h"
4+
<iostream>
5+
<string>
6+
<vector>
7+
8+
1324464428 source:c:\users\abhinav\desktop\btp\model based testing\tinystr.cpp
9+
"tinystr.h"
10+
11+
1324464428 c:\users\abhinav\desktop\btp\model based testing\tinystr.h
12+
<assert.h>
13+
<string.h>
14+
15+
1334601368 source:c:\users\abhinav\desktop\btp\model based testing\tinyxml.cpp
16+
<ctype.h>
17+
<vector>
18+
<sstream>
19+
<iostream>
20+
"tinyxml.h"
21+
22+
1334601472 c:\users\abhinav\desktop\btp\model based testing\tinyxml.h
23+
<vector>
24+
<string>
25+
<ctype.h>
26+
<stdio.h>
27+
<stdlib.h>
28+
<string.h>
29+
<assert.h>
30+
<string>
31+
<iostream>
32+
<sstream>
33+
"tinystr.h"
34+
35+
1324464428 source:c:\users\abhinav\desktop\btp\model based testing\tinyxmlerror.cpp
36+
"tinyxml.h"
37+
38+
1324464428 source:c:\users\abhinav\desktop\btp\model based testing\tinyxmlparser.cpp
39+
<ctype.h>
40+
<stddef.h>
41+
"tinyxml.h"
42+
<windows.h>
43+

Model Based Testing.layout

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_layout_file>
3+
<ActiveTarget name="Debug" />
4+
<File name="main.cpp" open="1" top="1" tabpos="0">
5+
<Cursor position="117" topLine="0" />
6+
</File>
7+
</CodeBlocks_layout_file>

main.cpp

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include "tinyxml.h"
2+
#include <iostream>
3+
#include <string>
4+
#include <vector>
5+
6+
using namespace std;
7+
8+
int main(int argc, char* argv[])
9+
{
10+
TiXmlDocument doc;
11+
if(!doc.LoadFile("C:/Users/Abhinav/Desktop/BTP/Model Based Testing/test.xml"))
12+
{
13+
cerr << doc.ErrorDesc() << endl;
14+
return 0;
15+
}
16+
TiXmlElement* root = doc.FirstChildElement();
17+
if(root == NULL)
18+
{
19+
cerr << "Failed to load file: No root element." << endl;
20+
doc.Clear();
21+
return 0;
22+
}
23+
//TiXmlElement* elem = root->FirstChildElement()->NextSiblingElement();
24+
//cout<<elem->Attribute("att");
25+
vector<TiXmlElement*> list;
26+
list=root->GetElementsByTagName("message",list);
27+
for(int i=0;i<list.size();i++)
28+
cout<<list[i]->Attribute("xmi:id")<<endl;
29+
//getchar();
30+
return 0;
31+
}

test.xml

+1,415
Large diffs are not rendered by default.

tinystr.cpp

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/*
2+
www.sourceforge.net/projects/tinyxml
3+
Original file by Yves Berquin.
4+
5+
This software is provided 'as-is', without any express or implied
6+
warranty. In no event will the authors be held liable for any
7+
damages arising from the use of this software.
8+
9+
Permission is granted to anyone to use this software for any
10+
purpose, including commercial applications, and to alter it and
11+
redistribute it freely, subject to the following restrictions:
12+
13+
1. The origin of this software must not be misrepresented; you must
14+
not claim that you wrote the original software. If you use this
15+
software in a product, an acknowledgment in the product documentation
16+
would be appreciated but is not required.
17+
18+
2. Altered source versions must be plainly marked as such, and
19+
must not be misrepresented as being the original software.
20+
21+
3. This notice may not be removed or altered from any source
22+
distribution.
23+
*/
24+
25+
/*
26+
* THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005.
27+
*/
28+
29+
30+
#ifndef TIXML_USE_STL
31+
32+
#include "tinystr.h"
33+
34+
// Error value for find primitive
35+
const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1);
36+
37+
38+
// Null rep.
39+
TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } };
40+
41+
42+
void TiXmlString::reserve (size_type cap)
43+
{
44+
if (cap > capacity())
45+
{
46+
TiXmlString tmp;
47+
tmp.init(length(), cap);
48+
memcpy(tmp.start(), data(), length());
49+
swap(tmp);
50+
}
51+
}
52+
53+
54+
TiXmlString& TiXmlString::assign(const char* str, size_type len)
55+
{
56+
size_type cap = capacity();
57+
if (len > cap || cap > 3*(len + 8))
58+
{
59+
TiXmlString tmp;
60+
tmp.init(len);
61+
memcpy(tmp.start(), str, len);
62+
swap(tmp);
63+
}
64+
else
65+
{
66+
memmove(start(), str, len);
67+
set_size(len);
68+
}
69+
return *this;
70+
}
71+
72+
73+
TiXmlString& TiXmlString::append(const char* str, size_type len)
74+
{
75+
size_type newsize = length() + len;
76+
if (newsize > capacity())
77+
{
78+
reserve (newsize + capacity());
79+
}
80+
memmove(finish(), str, len);
81+
set_size(newsize);
82+
return *this;
83+
}
84+
85+
86+
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b)
87+
{
88+
TiXmlString tmp;
89+
tmp.reserve(a.length() + b.length());
90+
tmp += a;
91+
tmp += b;
92+
return tmp;
93+
}
94+
95+
TiXmlString operator + (const TiXmlString & a, const char* b)
96+
{
97+
TiXmlString tmp;
98+
TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) );
99+
tmp.reserve(a.length() + b_len);
100+
tmp += a;
101+
tmp.append(b, b_len);
102+
return tmp;
103+
}
104+
105+
TiXmlString operator + (const char* a, const TiXmlString & b)
106+
{
107+
TiXmlString tmp;
108+
TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) );
109+
tmp.reserve(a_len + b.length());
110+
tmp.append(a, a_len);
111+
tmp += b;
112+
return tmp;
113+
}
114+
115+
116+
#endif // TIXML_USE_STL

0 commit comments

Comments
 (0)