	// Define what to do as a constructor (not much, in this case)
	UT.setup( function(){ 
		// TypeOf is an alias of getObjType, but the unit test does not recognise it as a 'valid' function.
		UT.allowTaint("TypeOf");
		
		// Those defined variables? We now define them with default values
		A = 56;
		B = "hello";
		C = CreateColor(5, 6, 7, 8);
		D = GetSystemFont();
		E = GetSystemArrow();
		F = E.createSurface();
		G = CreateColorMatrix(1,2,3,4, 5,6,7,8, 9,10,11,12);
		H = GetSystemWindowStyle();
		I = CreateByteArray(5);
		J = null;
		K = undefined;
		L = "This is a test of a very long string. But remember, the anwser is always 41.999999535532";
		M = undefined;
		N = undefined;
		Z = { A:A, B:B, C:C, J:J, K:K };
	} );
	// Define what to do as a destructor
	UT.teardown( function(){ } );


	// Now run the setup and first batch of tests
	// Note that we need to have a test for all defined functions in timer.js
	UT.setup().runtests({
	
		// Each entry is the name of a test suite, usually a function or object

		COLOR: function(that){
			UT.assertEquals(C.toJSON(), "CreateColor(5,6,7,8)", 'toJSON()');
			UT.assertEquals(C.red, 5, 'read red component');
			UT.assertEquals(C.green, 6, 'read green component');
			UT.assertEquals(C.blue, 7, 'read blue component');
			UT.assertEquals(C.alpha, 8, 'read alpha component');
			C = CreateColor(400,500,600,700);
			UT.assertEquals(C.alpha, 255, 'clamp alpha createColor()');
			C.red=256;
			UT.assertEquals(C.red, 255, 'clamp red assigned');
		},
	
		COLORMATRIX: function(that){
			UT.assertEquals(G.toJSON(), "CreateColorMatrix(1,2,3,4,5,6,7,8,9,10,11,12)", 'toJSON()');
			G.rn = 257;
			UT.assertEquals(G.rn, 257, 'assign rn');
			G.rg = -1200;
			UT.assertEquals(G.rg, -1200, 'assign negative rg');
		},
	
		FLATE: function(that){

			M = CreateByteArrayFromString(L);
			UT.assertEquals(L.length,M.length, 'bytearray length');
			UT.assertEquals(L, CreateStringFromByteArray(M), 'convert back to string');
			N = DeflateByteArray(M);
			UT.assertTrue( N.length < M.lenght, 'deflate actually compresses');
			UT.assertEqualType(N, I, 'deflate to correct object');
			UT.assertEquals(M, InflateByteArray(N), 'inflate to same ByteArray');
			UT.assertEquals(L, CreateStringFromByteArray(InflateByteArray(N)), 'inflate to same string');

			F = OpenRawFile("../scripts/test_all.js",false);
			M = F.read(Z=F.getSize()); // Z now the size of this very file
			F.close();
			
			DeflateFile("../scripts/test_all.js", "tmp.deflated");
			F = OpenRawFile("tmp.deflated",false);
			N = F.read(F.getSize());
			F.close();

			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M),Z+1024), 'reflate');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,9),Z+1024), 'reflate 9');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,8),Z+1024), 'reflate 8');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,7),Z+1024), 'reflate 7');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,6),Z+1024), 'reflate 6');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,5),Z+1024), 'reflate 5');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,4),Z+1024), 'reflate 4');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,3),Z+1024), 'reflate 3');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,2),Z+1024), 'reflate 2');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,1),Z+1024), 'reflate 1');
			UT.assertEquals(M,InflateByteArray(DeflateByteArray(M,0),Z+1024), 'reflate 0');

			UT.assertEqualType(M,N, 'bytearrays')
			UT.assertNotEquals(M,A =InflateByteArray(N,Z-8), 'reflate too small buffer');
			A[2] = 12;
			UT.assertNotEquals(M,A, 'not equal bytearrays by data');
			A = M.slice(0,M.length); // M.clone();
			UT.assertEquals(M,A, 'ByteArray clone');
			A.length = 5;
			UT.assertEquals(M.length,A.length, 'length read-only');
			A = M.slice(1,M.length-2);
			UT.assertNotEquals(M.lenght,A.length, 'not equal bytearrays by length');
			UT.assertNotEquals(M,A, 'not equal bytearrays');
		},
		
		SPHERE16: function(that){
			UT.assertEquals(GetVersion(), 1.6, 'Sphere 1.6');
			UT.assertEquals(GetVersionString(), 'v1.6', 'Sphere v1.6');
			UT.assertString(GetVersionString(), 'GVS() is string');
		},
		
		GetGlobalConfiguration: function(that){
			UT.assertInteger(GetGlobalConfiguration(0), 'GetGlobalConfiguration 0');
			UT.assertInteger(GetGlobalConfiguration(1), 'GetGlobalConfiguration 1');
			UT.assertInteger(GetGlobalConfiguration(2), 'GetGlobalConfiguration 2');
			UT.assertString("c", 'fraction not integer');
			UT.assertBoolean(true, 'fraction not integer');
		},
		


		SPRITESETS: function(that){
			Z = CreateSpriteset(16, 32, 12, 4, 12)
			Z.save('ss.rss');
			CreatePerson('p', 'ss.rss', false);
			B = GetPersonBase('p');
			UT.assertType(B,'base', 'isbase')

			SetPersonBase('p', 1,2,3,4);
			C = GetPersonSpriteset('p');
			UT.assertEquals(C.base.y1, 2, 'setpersonbase')
			//D = C.clone();
			//UT.assertEquals(C.base.y1, 2, 'clone');
		},



	});
