4022 lines
193 KiB
C++
4022 lines
193 KiB
C++
/**
|
|
* @author Edouard DUPIN
|
|
* @copyright 2017, Edouard DUPIN, all right reserved
|
|
* @license MPL-2 (see license file)
|
|
*/
|
|
#include <estyle/estyle.hpp>
|
|
#include <estyle/Generator.hpp>
|
|
#include <etk/etk.hpp>
|
|
#include <test-debug/debug.hpp>
|
|
#include <etest/etest.hpp>
|
|
|
|
static etk::String sourceBrace0Action = "action_A;do{}while(true);action_D;";
|
|
static etk::String sourceBrace1Action = "action_A;do{action_B;}while(true);action_D;";
|
|
static etk::String sourceBrace1ActionNoBrace = "action_A;do action_B; while(true);action_D;";
|
|
static etk::String sourceBrace2Action = "action_A;do{action_B;action_C;}while(true);action_D;";
|
|
|
|
|
|
TEST(testDoWhile, brace_100000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{action_B;\n}while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_101000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{action_B;\n}while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_101100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{ action_B;\n} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_110000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{\naction_B;\n}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_110100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{\naction_B;\n}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_111000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{\naction_B;\n}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_111100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{\naction_B;\n}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_100100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{ action_B;\n} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, brace_010000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{\naction_B;}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_010100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{\naction_B;}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_011000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {\naction_B; }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_001000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {action_B; }while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_001100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do { action_B; } while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_011100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {\naction_B; }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_000100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{ action_B;} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testDoWhile, brace_100001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{action_B;\n}while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_101001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{action_B;\n}while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_101101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{ action_B;\n} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_110001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{\n\taction_B;\n}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_110101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{\n\taction_B;\n}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_111001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{\n\taction_B;\n}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_111101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{\n\taction_B;\n}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_100101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n{ action_B;\n} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, brace_010001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{\n\taction_B;}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_010101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{\n\taction_B;}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_011001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {\n\taction_B; }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_001001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {action_B; }while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_001101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do { action_B; } while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_011101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {\n\taction_B; }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_000101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{ action_B;} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testDoWhile, brace_100010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{action_B;\n\t}while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_101010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{action_B;\n\t}while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_101110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{ action_B;\n\t} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_110010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\taction_B;\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_110110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\taction_B;\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_111010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\taction_B;\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_111110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\taction_B;\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_100110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{ action_B;\n\t} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, brace_010010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{\n\taction_B;}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_010110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{\n\taction_B;}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_011010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {\n\taction_B; }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_001010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {action_B; }while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_001110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do { action_B; } while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_011110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {\n\taction_B; }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_000110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
//interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{ action_B;} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testDoWhile, brace_100011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{action_B;\n\t}while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_101011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{action_B;\n\t}while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_101111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{ action_B;\n\t} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_110011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\t\taction_B;\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_110111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\t\taction_B;\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_111011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\t\taction_B;\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_111111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\t\taction_B;\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_100111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do\n\t{ action_B;\n\t} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, brace_010011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{\n\t\taction_B;}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_010111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{\n\t\taction_B;}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_011011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {\n\t\taction_B; }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_001011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
//interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
//interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {action_B; }while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_001111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do { action_B; } while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_011111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do {\n\t\taction_B; }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_000111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-do-while-single", "true");
|
|
etk::String outRef = "action_A;do{ action_B;} while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(testDoWhile, brace_single_000) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "40");
|
|
interface.properties.set("brace-do-while-single", "true");
|
|
//interface.properties.set("brace-do-while-single-in-new-line", "true");
|
|
//interface.properties.set("brace-do-while-single-in-space", "true");
|
|
//interface.properties.set("brace-do-while-single-out-new-line", "true");
|
|
//interface.properties.set("brace-do-while-single-out-space", "true");
|
|
//interface.properties.set("brace-do-while-single-indent", "true");
|
|
etk::String outRef = "action_A;do action_B;while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_single_100) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "40");
|
|
interface.properties.set("brace-do-while-single", "true");
|
|
interface.properties.set("brace-do-while-single-in-new-line", "true");
|
|
//interface.properties.set("brace-do-while-single-in-space", "true");
|
|
interface.properties.set("brace-do-while-single-out-new-line", "true");
|
|
//interface.properties.set("brace-do-while-single-out-space", "true");
|
|
//interface.properties.set("brace-do-while-single-indent", "true");
|
|
etk::String outRef = "action_A;do\naction_B;\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_single_010) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "40");
|
|
interface.properties.set("brace-do-while-single", "true");
|
|
//interface.properties.set("brace-do-while-single-in-new-line", "true");
|
|
interface.properties.set("brace-do-while-single-in-space", "true");
|
|
//interface.properties.set("brace-do-while-single-out-new-line", "true");
|
|
interface.properties.set("brace-do-while-single-out-space", "true");
|
|
//interface.properties.set("brace-do-while-single-indent", "true");
|
|
etk::String outRef = "action_A;do action_B; while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
TEST(testDoWhile, brace_single_110) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "40");
|
|
interface.properties.set("brace-do-while-single", "true");
|
|
interface.properties.set("brace-do-while-single-in-new-line", "true");
|
|
interface.properties.set("brace-do-while-single-in-space", "true");
|
|
interface.properties.set("brace-do-while-single-out-new-line", "true");
|
|
interface.properties.set("brace-do-while-single-out-space", "true");
|
|
//interface.properties.set("brace-do-while-single-indent", "true");
|
|
etk::String outRef = "action_A;do\naction_B;\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
|
|
TEST(testDoWhile, brace_single_001) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "40");
|
|
interface.properties.set("brace-do-while-single", "true");
|
|
//interface.properties.set("brace-do-while-single-in-new-line", "true");
|
|
//interface.properties.set("brace-do-while-single-in-space", "true");
|
|
//interface.properties.set("brace-do-while-single-out-new-line", "true");
|
|
//interface.properties.set("brace-do-while-single-out-space", "true");
|
|
interface.properties.set("brace-do-while-single-indent", "true");
|
|
etk::String outRef = "action_A;do action_B;while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_single_101) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "40");
|
|
interface.properties.set("brace-do-while-single", "true");
|
|
interface.properties.set("brace-do-while-single-in-new-line", "true");
|
|
//interface.properties.set("brace-do-while-single-in-space", "true");
|
|
interface.properties.set("brace-do-while-single-out-new-line", "true");
|
|
//interface.properties.set("brace-do-while-single-out-space", "true");
|
|
interface.properties.set("brace-do-while-single-indent", "true");
|
|
etk::String outRef = "action_A;do\n\taction_B;\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_single_011) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "40");
|
|
interface.properties.set("brace-do-while-single", "true");
|
|
//interface.properties.set("brace-do-while-single-in-new-line", "true");
|
|
interface.properties.set("brace-do-while-single-in-space", "true");
|
|
//interface.properties.set("brace-do-while-single-out-new-line", "true");
|
|
interface.properties.set("brace-do-while-single-out-space", "true");
|
|
interface.properties.set("brace-do-while-single-indent", "true");
|
|
etk::String outRef = "action_A;do action_B; while(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
TEST(testDoWhile, brace_single_111) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "40");
|
|
interface.properties.set("brace-do-while-single", "true");
|
|
interface.properties.set("brace-do-while-single-in-new-line", "true");
|
|
interface.properties.set("brace-do-while-single-in-space", "true");
|
|
interface.properties.set("brace-do-while-single-out-new-line", "true");
|
|
interface.properties.set("brace-do-while-single-out-space", "true");
|
|
interface.properties.set("brace-do-while-single-indent", "true");
|
|
etk::String outRef = "action_A;do\n\taction_B;\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
output = interface.process(sourceBrace1ActionNoBrace);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
TEST(testDoWhile, brace_empty_000) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// empty
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "0");
|
|
//interface.properties.set("brace-empty-space", "true");
|
|
//interface.properties.set("brace-empty-indent", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_empty_100) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("brace-do-while-one-line-size-max", "0");
|
|
//interface.properties.set("brace-do-while-empty-space", "true");
|
|
//interface.properties.set("brace-do-while-empty-indent", "true");
|
|
etk::String outRef = "action_A;do {}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_empty_110) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("brace-do-while-one-line-size-max", "0");
|
|
interface.properties.set("brace-do-while-empty-space", "true");
|
|
//interface.properties.set("brace-do-while-empty-indent", "true");
|
|
etk::String outRef = "action_A;do { }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_empty_111) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("brace-do-while-one-line-size-max", "0");
|
|
interface.properties.set("brace-do-while-empty-space", "true");
|
|
interface.properties.set("brace-do-while-empty-indent", "true");
|
|
etk::String outRef = "action_A;do { }\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, brace_empty_001) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-do-while-in-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-in-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-in-space-before", "true");
|
|
interface.properties.set("brace-do-while-in-space-after", "true");
|
|
interface.properties.set("brace-do-while-in-indent-before", "true");
|
|
interface.properties.set("brace-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-do-while-out-new-line-before", "true");
|
|
interface.properties.set("brace-do-while-out-new-line-after", "true");
|
|
interface.properties.set("brace-do-while-out-space-before", "true");
|
|
interface.properties.set("brace-do-while-out-space-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-after", "true");
|
|
interface.properties.set("brace-do-while-out-unindent-before", "true");
|
|
// empty
|
|
//interface.properties.set("brace-do-while-one-line-size-max", "0");
|
|
//interface.properties.set("brace-do-while-empty-space", "true");
|
|
interface.properties.set("brace-do-while-empty-indent", "true");
|
|
etk::String outRef = "action_A;do\n\t{\n\t\t\n\t}\nwhile(true);action_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------------------------------------------------
|
|
// -- Condition section: ()
|
|
// -----------------------------------------------------------------------------------------------------------------------
|
|
|
|
static etk::String sourceCondition0 = "do{}while(){}";
|
|
static etk::String sourceCondition1 = "do{}while(elementA==true){}";
|
|
static etk::String sourceCondition2 = "do{}while(elementA==false&&(elementB==99||not elementC)&&!elementD){}";
|
|
|
|
|
|
TEST(testDoWhile, condition_100000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(elementA==true\n){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(elementA==false&&(elementB==99||not elementC)&&!elementD){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_101000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(elementA==true\n){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(elementA==false&&(elementB==99||not elementC)&&!elementD\n){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_101100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n( elementA==true\n) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n( elementA==false&&(elementB==99||not elementC)&&!elementD\n) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_110000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(\nelementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(\nelementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_110100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(\nelementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(\nelementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_111000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(\nelementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(\nelementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_111100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(\nelementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(\nelementA==false&&(elementB==99||not elementC)&&!elementD\n){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_100100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n( elementA==true\n) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n( elementA==false&&(elementB==99||not elementC)&&!elementD\n) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, condition_010000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while(\nelementA==true)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while(\nelementA==false&&(elementB==99||not elementC)&&!elementD)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_010100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while(\nelementA==true)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while(\nelementA==false&&(elementB==99||not elementC)&&!elementD)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_011000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while (\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (\nelementA==true )\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (\nelementA==false&&(elementB==99||not elementC)&&!elementD )\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_001000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( ){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (elementA==true ){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (elementA==false&&(elementB==99||not elementC)&&!elementD ){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_001100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while ( elementA==true ) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while ( elementA==false&&(elementB==99||not elementC)&&!elementD ) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_011100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while (\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (\nelementA==true )\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (\nelementA==false&&(elementB==99||not elementC)&&!elementD )\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_000100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while( elementA==true) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while( elementA==false&&(elementB==99||not elementC)&&!elementD) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testDoWhile, condition_100001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(elementA==true\n){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(elementA==false&&(elementB==99||not elementC)&&!elementD\n){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_101001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(elementA==true\n){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(elementA==false&&(elementB==99||not elementC)&&!elementD\n){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_101101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(elementA==true\n){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n( elementA==false&&(elementB==99||not elementC)&&!elementD\n){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_110001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(\n\telementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(\n\telementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, condition_110101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while(){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while(elementA==true){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while(elementA==false&&(elementB==99||not elementC)&&!elementD){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_111001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(\n\telementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(\n\telementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_111101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(\n\telementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(\n\telementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_100101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n( elementA==true\n) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n( elementA==false&&(elementB==99||not elementC)&&!elementD\n) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, condition_010001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n(elementA==true\n){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n(elementA==false&&(elementB==99||not elementC)&&!elementD\n){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_010101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while(\n\telementA==true)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while(\n\telementA==false&&(elementB==99||not elementC)&&!elementD)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_011001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while (\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (\n\telementA==true )\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (\n\telementA==false&&(elementB==99||not elementC)&&!elementD )\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_001001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( ){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (elementA==true ){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (elementA==false&&(elementB==99||not elementC)&&!elementD ){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_001101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while ( elementA==true ) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while ( elementA==false&&(elementB==99||not elementC)&&!elementD ) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_011101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while (\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (\n\telementA==true )\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (\n\telementA==false&&(elementB==99||not elementC)&&!elementD )\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_000101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while( elementA==true) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while( elementA==false&&(elementB==99||not elementC)&&!elementD) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testDoWhile, condition_100010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(elementA==true\n\t){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(elementA==false&&(elementB==99||not elementC)&&!elementD\n\t){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_101010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(elementA==true\n){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(elementA==false&&(elementB==99||not elementC)&&!elementD\n){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_101110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t( elementA==true\n){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t( elementA==false&&(elementB==99||not elementC)&&!elementD\n){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_110010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\telementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\telementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_110110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\telementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\telementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_111010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\telementA==true\n)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\telementA==false&&(elementB==99||not elementC)&&!elementD\n)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_111110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\telementA==true\n\t)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_100110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t( elementA==true\n\t) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t( elementA==false&&(elementB==99||not elementC)&&!elementD\n\t) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, condition_010010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while(\n\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while(\n\telementA==true)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while(\n\telementA==false&&(elementB==99||not elementC)&&!elementD)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_010110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while(\n\t) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while(\n\telementA==true)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while(\n\telementA==false&&(elementB==99||not elementC)&&!elementD)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_011010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while (\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (\n\telementA==true )\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (\n\telementA==false&&(elementB==99||not elementC)&&!elementD )\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_001010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( ){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (elementA==true ){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (elementA==false&&(elementB==99||not elementC)&&!elementD ){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_001110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while ( elementA==true ) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while ( elementA==false&&(elementB==99||not elementC)&&!elementD ) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_011110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while (\n)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (\n\telementA==true )\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (\n\telementA==false&&(elementB==99||not elementC)&&!elementD )\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_000110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while( elementA==true) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while( elementA==false&&(elementB==99||not elementC)&&!elementD) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testDoWhile, condition_100011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(elementA==true\n\t){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(elementA==false&&(elementB==99||not elementC)&&!elementD\n\t){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_101011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(elementA==true\n\t){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(elementA==false&&(elementB==99||not elementC)&&!elementD\n\t){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_101111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t( elementA==true\n\t) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t( elementA==false&&(elementB==99||not elementC)&&!elementD\n\t) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_110011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t)\n\t{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n\t{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n\t{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_110111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t)\n\t{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n\t{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n\t{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_111011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t)\n\t{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n\t{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n\t{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_111111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t)\n\t{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n\t{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n\t{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_100111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t( elementA==true\n\t) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t( elementA==false&&(elementB==99||not elementC)&&!elementD\n\t) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testDoWhile, condition_010011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while(\n\t\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while(\n\t\telementA==true)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_010111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while(\n\t\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while(\n\t\telementA==true)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_011011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while (\n\t\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (\n\t\telementA==true )\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD )\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_001011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( ){}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (elementA==true ){}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (elementA==false&&(elementB==99||not elementC)&&!elementD ){}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_001111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while ( elementA==true ) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while ( elementA==false&&(elementB==99||not elementC)&&!elementD ) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_011111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while (\n\t\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while (\n\t\telementA==true )\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while (\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD )\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_000111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
//interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
//interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("parenthese-do-while-single", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while( ) {}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while( elementA==true) {}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while( elementA==false&&(elementB==99||not elementC)&&!elementD) {}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
TEST(testDoWhile, condition_empty_000) {
|
|
estyle::Generator interface;
|
|
// in out for specdo{}whileic empty change:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// empty
|
|
//interface.properties.set("parenthese-do-while-one-line-size-max", "0");
|
|
//interface.properties.set("parenthese-empty-space", "true");
|
|
//interface.properties.set("parenthese-empty-indent", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_empty_100) {
|
|
estyle::Generator interface;
|
|
// in out for specdo{}whileic empty change:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("parenthese-do-while-one-line-size-max", "0");
|
|
//interface.properties.set("parenthese-do-while-empty-space", "true");
|
|
//interface.properties.set("parenthese-do-while-empty-indent", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ()\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_empty_110) {
|
|
estyle::Generator interface;
|
|
// in out for specdo{}whileic empty change:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("parenthese-do-while-one-line-size-max", "0");
|
|
interface.properties.set("parenthese-do-while-empty-space", "true");
|
|
//interface.properties.set("parenthese-do-while-empty-indent", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( )\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_empty_111) {
|
|
estyle::Generator interface;
|
|
// in out for specdo{}whileic empty change:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("parenthese-do-while-one-line-size-max", "0");
|
|
interface.properties.set("parenthese-do-while-empty-space", "true");
|
|
interface.properties.set("parenthese-do-while-empty-indent", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while ( )\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testDoWhile, condition_empty_001) {
|
|
estyle::Generator interface;
|
|
// in out for specdo{}whileic empty change:
|
|
interface.properties.set("parenthese-do-while-in-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-before", "true");
|
|
interface.properties.set("parenthese-do-while-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("parenthese-do-while-out-new-line-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-new-line-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-before", "true");
|
|
interface.properties.set("parenthese-do-while-out-space-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-after", "true");
|
|
interface.properties.set("parenthese-do-while-out-unindent-before", "true");
|
|
// empty
|
|
//interface.properties.set("parenthese-do-while-one-line-size-max", "0");
|
|
//interface.properties.set("parenthese-do-while-empty-space", "true");
|
|
interface.properties.set("parenthese-do-while-empty-indent", "true");
|
|
// Force inside RAw mode
|
|
interface.properties.set("parenthese-do-while-mode", "true");
|
|
// TEST 1
|
|
etk::String outRef = "do{}while\n\t(\n\t\t\n\t)\n{}";
|
|
etk::String output = interface.process(sourceCondition0);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 2
|
|
outRef = "do{}while\n\t(\n\t\telementA==true\n\t)\n{}";
|
|
output = interface.process(sourceCondition1);
|
|
EXPECT_EQ(output, outRef);
|
|
// TEST 3
|
|
outRef = "do{}while\n\t(\n\t\telementA==false&&(elementB==99||not elementC)&&!elementD\n\t)\n{}";
|
|
output = interface.process(sourceCondition2);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|