extracttests: astyle formatting
This commit is contained in:
parent
d85fb9dd3d
commit
293631745a
|
@ -28,11 +28,11 @@ int main(const int argc, const char * const * const argv)
|
||||||
std::string line;
|
std::string line;
|
||||||
while (std::getline(f, line))
|
while (std::getline(f, line))
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::string::size_type pos = line.find_first_not_of(" ");
|
std::string::size_type pos = line.find_first_not_of(" ");
|
||||||
if (pos > 0 && pos != std::string::npos)
|
if (pos > 0 && pos != std::string::npos)
|
||||||
line.erase(0,pos);
|
line.erase(0, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.compare(0, 5, "void ") == 0)
|
if (line.compare(0, 5, "void ") == 0)
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ int main(const int argc, const char * const * const argv)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line =="}")
|
if (line == "}")
|
||||||
{
|
{
|
||||||
testname = "";
|
testname = "";
|
||||||
subcount = 0;
|
subcount = 0;
|
||||||
|
@ -54,90 +54,90 @@ int main(const int argc, const char * const * const argv)
|
||||||
fout << "#include <string.h>" << std::endl;
|
fout << "#include <string.h>" << std::endl;
|
||||||
fout << "#include <stdio.h>" << std::endl;
|
fout << "#include <stdio.h>" << std::endl;
|
||||||
fout << "#include <stdlib.h>" << std::endl;
|
fout << "#include <stdlib.h>" << std::endl;
|
||||||
|
|
||||||
if (testname == "nullpointer1")
|
if (testname == "nullpointer1")
|
||||||
{
|
{
|
||||||
if (subcount < 6)
|
if (subcount < 6)
|
||||||
{
|
{
|
||||||
fout << "class Token\n"
|
fout << "class Token\n"
|
||||||
<< "{\n"
|
<< "{\n"
|
||||||
<< "public:\n"
|
<< "public:\n"
|
||||||
<< " const char *str() const;\n"
|
<< " const char *str() const;\n"
|
||||||
<< " const Token *next() const;\n"
|
<< " const Token *next() const;\n"
|
||||||
<< " unsigned int size() const;\n"
|
<< " unsigned int size() const;\n"
|
||||||
<< " char read () const;\n"
|
<< " char read () const;\n"
|
||||||
<< " operator bool() const;\n"
|
<< " operator bool() const;\n"
|
||||||
<< "};\n"
|
<< "};\n"
|
||||||
<< "static Token *tokens;\n";
|
<< "static Token *tokens;\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fout << "struct A\n"
|
fout << "struct A\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" char b();\n"
|
" char b();\n"
|
||||||
" A *next;\n"
|
" A *next;\n"
|
||||||
"};\n";
|
"};\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testname == "nullpointer2")
|
if (testname == "nullpointer2")
|
||||||
{
|
{
|
||||||
fout << "class Fred\n"
|
fout << "class Fred\n"
|
||||||
<< "{\n"
|
<< "{\n"
|
||||||
<< "public:\n"
|
<< "public:\n"
|
||||||
<< " void hello() const;\n"
|
<< " void hello() const;\n"
|
||||||
<< " operator bool() const;\n"
|
<< " operator bool() const;\n"
|
||||||
<< "};\n";
|
<< "};\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testname == "nullpointer3")
|
if (testname == "nullpointer3")
|
||||||
{
|
{
|
||||||
fout << "struct DEF { };\n"
|
fout << "struct DEF { };\n"
|
||||||
<< "struct ABC : public DEF\n"
|
<< "struct ABC : public DEF\n"
|
||||||
<< "{\n"
|
<< "{\n"
|
||||||
<< " int a,b,c;\n"
|
<< " int a,b,c;\n"
|
||||||
<< " struct ABC *next;\n"
|
<< " struct ABC *next;\n"
|
||||||
<< "};\n"
|
<< "};\n"
|
||||||
<< "void bar(int); void f(struct ABC **);\n";
|
<< "void bar(int); void f(struct ABC **);\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testname == "nullpointer4")
|
if (testname == "nullpointer4")
|
||||||
{
|
{
|
||||||
fout << "void bar(int);\n"
|
fout << "void bar(int);\n"
|
||||||
<< "int** f(int **p = 0);\n"
|
<< "int** f(int **p = 0);\n"
|
||||||
<< "extern int x;\n"
|
<< "extern int x;\n"
|
||||||
<< "struct P {\n"
|
<< "struct P {\n"
|
||||||
<< " bool check() const;\n"
|
<< " bool check() const;\n"
|
||||||
<< " P* next() const;\n"
|
<< " P* next() const;\n"
|
||||||
<< "};\n";
|
<< "};\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testname == "nullpointer5")
|
if (testname == "nullpointer5")
|
||||||
{
|
{
|
||||||
fout << "struct A {\n"
|
fout << "struct A {\n"
|
||||||
<< " char c() const;\n"
|
<< " char c() const;\n"
|
||||||
<< " operator bool() const;\n"
|
<< " operator bool() const;\n"
|
||||||
<< "};\n";
|
<< "};\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testname == "nullpointer6")
|
if (testname == "nullpointer6")
|
||||||
{
|
{
|
||||||
fout << "struct Foo {\n"
|
fout << "struct Foo {\n"
|
||||||
<< " void abcd() const;\n"
|
<< " void abcd() const;\n"
|
||||||
<< "};\n"
|
<< "};\n"
|
||||||
<< "struct FooBar : public Foo { };\n"
|
<< "struct FooBar : public Foo { };\n"
|
||||||
<< "struct FooCar : public Foo { };\n"
|
<< "struct FooCar : public Foo { };\n"
|
||||||
<< "extern int a;\n";
|
<< "extern int a;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testname == "nullpointer7")
|
if (testname == "nullpointer7")
|
||||||
{
|
{
|
||||||
fout << "struct wxLongLong {\n"
|
fout << "struct wxLongLong {\n"
|
||||||
<< " wxLongLong(int) { }\n"
|
<< " wxLongLong(int) { }\n"
|
||||||
<< " long GetValue() const;\n"
|
<< " long GetValue() const;\n"
|
||||||
<< "};\n";
|
<< "};\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
std::string::size_type pos = line.find("\"");
|
std::string::size_type pos = line.find("\"");
|
||||||
|
|
Loading…
Reference in New Issue