2015-01-12 21:12:44 +01:00
|
|
|
/**
|
|
|
|
* @author Edouard DUPIN
|
|
|
|
*
|
2015-01-13 22:29:26 +01:00
|
|
|
* @copyright 2014, Edouard DUPIN, all right reserved
|
2015-01-12 21:12:44 +01:00
|
|
|
*
|
2017-01-05 21:28:23 +01:00
|
|
|
* @license MPL v2.0 (see license file)
|
2015-01-12 21:12:44 +01:00
|
|
|
*/
|
2016-02-02 21:18:54 +01:00
|
|
|
#pragma once
|
2015-01-12 21:12:44 +01:00
|
|
|
|
2016-09-30 22:28:36 +02:00
|
|
|
#include "testCommon.hpp"
|
2015-01-12 21:12:44 +01:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
|
2017-08-28 00:03:43 +02:00
|
|
|
static etk::String refOutputBoolean1("{\n\t\"tmpElement\": true\n}\n");
|
2015-01-12 21:12:44 +01:00
|
|
|
TEST(TestBoolean, testBaseTrue) {
|
|
|
|
localTest(refOutputBoolean1, "{ tmpElement:true }\n", -1);
|
|
|
|
}
|
|
|
|
TEST(TestBoolean, testTabbedTrue) {
|
|
|
|
localTest(refOutputBoolean1, "{ \t\ntmpElement:true \t\n }\n", -1);
|
|
|
|
}
|
|
|
|
TEST(TestBoolean, testNoneTrue) {
|
|
|
|
localTest(refOutputBoolean1, "tmpElement:true\n", -1);
|
|
|
|
}
|
|
|
|
TEST(TestBoolean, testBaseTrue1) {
|
|
|
|
localTest(refOutputBoolean1, "{ tmpElement:TRUE }\n", 1);
|
|
|
|
}
|
|
|
|
TEST(TestBoolean, testBaseTrue2) {
|
|
|
|
localTest(refOutputBoolean1, "{ tmpElement:True }\n", 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-08-28 00:03:43 +02:00
|
|
|
static etk::String refOutputBoolean2("{\n\t\"tmpElement\": false\n}\n");
|
2015-01-12 21:12:44 +01:00
|
|
|
TEST(TestBoolean, testBaseFalse) {
|
|
|
|
localTest(refOutputBoolean2, "{ tmpElement:false }\n", -1);
|
|
|
|
}
|
|
|
|
TEST(TestBoolean, testTabbedFalse) {
|
|
|
|
localTest(refOutputBoolean2, "{ \t\ntmpElement:false \t\n }\n", -1);
|
|
|
|
}
|
|
|
|
TEST(TestBoolean, testNoneFalse) {
|
|
|
|
localTest(refOutputBoolean2, "tmpElement:false\n", -1);
|
|
|
|
}
|
|
|
|
TEST(TestBoolean, testBaseFalse1) {
|
|
|
|
localTest(refOutputBoolean2, "{ tmpElement:FALSE }\n", 1);
|
|
|
|
}
|
|
|
|
TEST(TestBoolean, testBaseFalse2) {
|
|
|
|
localTest(refOutputBoolean2, "{ tmpElement:False }\n", 1);
|
|
|
|
}
|
|
|
|
|
2016-04-26 21:00:42 +02:00
|
|
|
TEST(TestBoolean, multipleValue) {
|
|
|
|
localTest("{\n\t\"tmpElement\": false,\n\t\"tmpElement2\": true\n}\n", "{ tmpElement:false, tmpElement2:true }\n", -1);
|
|
|
|
}
|