function check(assert, aViewContent, mSettings, vExpected) {
		var oLogMock,
			oViewContent = xml(assert, aViewContent),
			i;

		// setup
		if (!vExpected) { // derive expectations by smart filtering
			vExpected = [];
			for (i = 1; i < aViewContent.length - 1; i += 1) {
				// Note: <In> should really have some attributes to make sure they are kept!
				if (aViewContent[i].indexOf("<In ") === 0) {
					vExpected.push(aViewContent[i]);
				}
			}
		}
		if (Array.isArray(vExpected)) {
			vExpected.unshift(aViewContent[0]); // 1st line is always in
			vExpected.push(aViewContent[aViewContent.length - 1]); // last line is always in
			if (vExpected.length === 2) {
				// expect just a single empty tag
				vExpected = ['<mvc:View xmlns:mvc="sap.ui.core.mvc"/>'];
			}
		}
		// 'this' may be: null, window (IE9 w/o proper strict mode), oLogMock or the Sinon sandbox
		if (this) {
			if (this.expects) {
				oLogMock = this;
			} else if (this.mock) {
				oLogMock = this.mock(jQuery.sap.log);
			}
			if (oLogMock) {
				oLogMock.expects("error").never();
				oLogMock.expects("warning").never();
				aViewContent.forEach(function (sLine) {
					if (/if test="(false|true|\{= false \})"/.test(sLine)) {
						warn(oLogMock, sinon.match(/\[[ \d]\d\] Constant test condition/), sLine);
					}
				});
			}
		}

		withBalancedBindAggregation(assert, function () {
			withBalancedBindProperty(assert, function () {
				// code under test
				assert.strictEqual(process(oViewContent, mSettings), oViewContent);
			});
		});

		// assertions
		checkXml(assert, oViewContent, vExpected);
	}
/**
	 * Checks that our XMLPreprocessor works as expected on the given view content. If called on a
	 * <code>this</code> (which MUST be either a sandbox or a log mock), the view content is
	 * automatically searched for constant test conditions and appropriate warnings are expected;
	 * log output is stubbed in order to keep console clean. Makes sure there are no unexpected
	 * warnings or even errors.
	 *
	 * TODO replace "this" by additional first argument!
	 *
	 * @param {object} assert the assertions
	 * @param {string[]} aViewContent
	 *   the original view content
	 * @param {object} [mSettings={}]
	 *   a settings object for the preprocessor
	 * @param {string[]|RegExp} [vExpected]
	 *   the expected content as string array, with root element omitted; if missing, the
	 *   expectation is derived from the original view content by smart filtering. Alternatively
	 *   a regular expression which is expected to match the serialized original view content.
	 */
Checks that our XMLPreprocessor works as expected on the given view content. If called on a
this (which MUST be either a sandbox or a log mock), the view content is
automatically searched for constant test conditions and appropriate warnings are expected;
log output is stubbed in order to keep console clean. Makes sure there are no unexpected
warnings or even errors.



@param {object} assert the assertions
@param {string[]} aViewContent
the original view content
@param {object} [mSettings={}]
a settings object for the preprocessor
@param {string[]|RegExp} [vExpected]
the expected content as string array, with root element omitted; if missing, the
expectation is derived from the original view content by smart filtering. Alternatively
a regular expression which is expected to match the serialized original view content.
Checks that our XMLPreprocessor works as expected on the given view content . If called on a this ( which MUST be either a sandbox or a log mock ) the view content is automatically searched for constant test conditions and appropriate warnings are expected ; log output is stubbed in order to keep console clean . Makes sure there are no unexpected warnings or even errors . @param { object } assert the assertions @param { string [] } aViewContent the original view content @param { object } [ mSettings = {} ] a settings object for the preprocessor @param { string [] |RegExp } [ vExpected ] the expected content as string array with root element omitted ; if missing the expectation is derived from the original view content by smart filtering . Alternatively a regular expression which is expected to match the serialized original view content .
function check(assert, aViewContent, mSettings, vExpected) {
		var oLogMock,
			oViewContent = xml(assert, aViewContent),
			i;
		if (!vExpected) { 
			vExpected = [];
			for (i = 1; i < aViewContent.length - 1; i += 1) {
				if (aViewContent[i].indexOf("<In ") === 0) {
					vExpected.push(aViewContent[i]);
				}
			}
		}
		if (Array.isArray(vExpected)) {
			vExpected.unshift(aViewContent[0]); 
			vExpected.push(aViewContent[aViewContent.length - 1]); 
			if (vExpected.length === 2) {
				vExpected = ['<mvc:View xmlns:mvc="sap.ui.core.mvc"/>'];
			}
		}
		if (this) {
			if (this.expects) {
				oLogMock = this;
			} else if (this.mock) {
				oLogMock = this.mock(jQuery.sap.log);
			}
			if (oLogMock) {
				oLogMock.expects("error").never();
				oLogMock.expects("warning").never();
				aViewContent.forEach(function (sLine) {
					if (/if test="(false|true|\{= false \})"/.test(sLine)) {
						warn(oLogMock, sinon.match(/\[[ \d]\d\] Constant test condition/), sLine);
					}
				});
			}
		}
		withBalancedBindAggregation(assert, function () {
			withBalancedBindProperty(assert, function () {
				assert.strictEqual(process(oViewContent, mSettings), oViewContent);
			});
		});
		checkXml(assert, oViewContent, vExpected);
	}
function check ( assert , aViewContent , mSettings , vExpected ) { var oLogMock , oViewContent = xml ( assert , aViewContent ) , i ; if ( ! vExpected ) { vExpected = [ ] ; for ( i = 1 ; i < aViewContent . length - 1 ; i += 1 ) { if ( aViewContent [ i ] . indexOf ( "<In " ) === 0 ) { vExpected . push ( aViewContent [ i ] ) ; } } } if ( Array . isArray ( vExpected ) ) { vExpected . unshift ( aViewContent [ 0 ] ) ; vExpected . push ( aViewContent [ aViewContent . length - 1 ] ) ; if ( vExpected . length === 2 ) { vExpected = [ '<mvc:View xmlns:mvc="sap.ui.core.mvc"/>' ] ; } } if ( this ) { if ( this . expects ) { oLogMock = this ; } else if ( this . mock ) { oLogMock = this . mock ( jQuery . sap . log ) ; } if ( oLogMock ) { oLogMock . expects ( "error" ) . never ( ) ; oLogMock . expects ( "warning" ) . never ( ) ; aViewContent . forEach ( function ( sLine ) { if ( / if test="(false|true|\{= false \})" / . test ( sLine ) ) { warn ( oLogMock , sinon . match ( / \[[ \d]\d\] Constant test condition / ) , sLine ) ; } } ) ; } } withBalancedBindAggregation ( assert , function ( ) { withBalancedBindProperty ( assert , function ( ) { assert . strictEqual ( process ( oViewContent , mSettings ) , oViewContent ) ; } ) ; } ) ; checkXml ( assert , oViewContent , vExpected ) ; }
Checks that our XMLPreprocessor works as expected on the given view content.
Checks that our XMLPreprocessor works as expected on the given view content .
// setup // derive expectations by smart filtering // Note: <In> should really have some attributes to make sure they are kept! // 1st line is always in // last line is always in // expect just a single empty tag // 'this' may be: null, window (IE9 w/o proper strict mode), oLogMock or the Sinon sandbox // code under test // assertions