示例#1
0
void TestRegression::testSysmgrFailure_data()
{
	INIT_SCHEMA_TEST_DATA;

	JValue faultyInput;
	std::string input;
	std::string validSchema;

	validSchema = "{\"type\":\"object\",\"properties\":{\"quicklaunch\":{\"type\":\"boolean\",\"optional\":true},\"launcher\":{\"type\":\"boolean\",\"optional\":true},\"universal search\":{\"type\":\"boolean\",\"optional\":true}},\"additionalProperties\":false}";
	faultyInput = Object();
	faultyInput.put("universal search", false);
	faultyInput.put("launcher", false);
	toString(faultyInput, input);

	QTest::newRow("schema test from sysmgr crash") << input << validSchema << true;
}
示例#2
0
void TestRegression::testNOV99444_data()
{
	INIT_SCHEMA_TEST_DATA;

	std::string input;

	std::string faultySchema =
	"{"
	        "\"type\" : \"object\","
	        "\"properties\" : {"
	                "\"errorCode\" : {"
	                        "\"type\" : \"integer\";"
	                "}"
	        "}"
	"}";

	std::string validSchema =
	"{"
	        "\"type\" : \"object\","
	        "\"properties\" : {"
	                "\"errorCode\" : {"
	                        "\"type\" : \"integer\""
	                "}"
	        "}"
	"}";

	JValue faultyInput;

	faultyInput = Object();
	faultyInput.put("returnValue", false);
	faultyInput.put("errorCode", -1);
	faultyInput.put("errorText", "Launch helper exited with unknown return code 0");
	toString(faultyInput, input);
	QTest::newRow("bad schema test") << input << faultySchema << false;
	QTest::newRow("schema test from bug") << input << validSchema << true;
}