aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/default/textures/default_sand.png
blob: 1a56cc737ff404bc230d051d8f33658fb7ef476e (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 08 03 00 00 00 28 2d 0f .PNG........IHDR.............(-.
0020 53 00 00 01 9e 50 4c 54 45 bb aa 85 be ad 88 be ae 89 c0 af 86 c0 b0 8a c0 b0 8b c1 b0 8b c1 b0 S....PLTE.......................
0040 8c c2 b1 89 c2 b1 8a c2 b1 8c c4 b4 8d c4 b4 8f c4 b4 90 c5 b4 90 c6 b5 90 c6 b6 90 c6 b6 91 c6 ................................
0060 b7 8f c7 b6 8d c7 b6 90 c8 b7 91 c8 b7 93 c8 b8 8f c8 b8 90 c8 b8 92 c8 b8 93 c8 b9 90 c8 b9 91 ................................
0080 c9 b8 90 c9 b8 91 c9 b9 94 ca ba 94 ca ba 95 cb b9 95 cb ba 94 cb bb 95 cb bb 96 cb bc 94 cc bb ................................
00a0 95 cc bb 97 cc bc 94 cc bc 96 cc bc 98 cc bd 94 cc bd 95 cd bc 95 cd bc 97 cd bc 98 cd bd 98 ce ................................
00c0 be 99 ce bf 95 ce bf 97 cf bd 99 cf be 97 cf bf 9a d0 be 9a d0 bf 98 d0 bf 99 d0 bf 9a d0 bf 9b ................................
00e0 d0 c0 98 d0 c0 9b d0 c1 99 d1 bf 9b d1 c0 98 d1 c0 99 d1 c0 9b d1 c1 9b d1 c1 9c d1 c2 98 d1 c2 ................................
0100 9a d2 c1 9b d2 c2 9d d2 c3 9b d3 c1 9d d3 c2 9b d3 c2 9e d3 c3 9d d3 c3 9e d3 c3 9f d4 c3 9c d4 ................................
0120 c3 9e d4 c3 9f d4 c4 9f d4 c5 9b d5 c3 9f d5 c4 9f d6 c4 a0 d6 c5 9f d6 c6 a0 d6 c6 a1 d7 c5 a1 ................................
0140 d7 c6 a0 d7 c6 a2 d7 c7 9e d7 c7 a1 d7 c7 a2 d7 c7 a3 d8 c7 a0 d8 c7 a2 d8 c7 a3 d8 c8 a3 d9 c7 ................................
0160 a3 d9 c8 a1 d9 c8 a3 d9 c9 a4 d9 ca a2 da c8 a4 da c9 a0 da c9 a3 da ca a5 db c9 a5 db ca a3 db ................................
0180 ca a4 db ca a5 db cb a7 dc ca a7 dc cb a3 dc cb a6 dc cc a7 dd cb a7 dd cc a7 dd cd a8 de cc a8 ................................
01a0 de ce a8 de ce a9 de ce aa df ce a9 df d0 a8 e1 cf ab e2 d0 ac e3 d2 ae e4 d4 af e6 d4 b0 e6 d6 ................................
01c0 b1 e7 d7 b2 e9 d7 b3 7d b9 b1 f3 00 00 01 17 49 44 41 54 78 da 05 c1 09 23 c2 60 18 00 e0 d7 7d .......}.......IDATx....#.`....}
01e0 e5 36 12 ca 24 39 12 9b 14 6d 7d 45 92 12 5b 35 64 29 2d 19 a5 93 58 35 1d 0c f1 af 3d 0f 14 8b .6..$9...m}E..[5d)-...X5....=...
0200 ca 5f 51 6e 94 9b 9e 1e 0d 97 11 86 21 be 97 bd 54 08 b6 22 27 19 c4 10 1e 02 aa 91 1b d7 4f 43 ._Qn........!...T.."'.........OC
0220 fe 8e b2 32 22 39 72 03 1e ee bf e2 af 15 a6 61 e3 7e 85 64 9f 26 0a 4b db 4a e4 94 1d 17 b8 72 ...2"9r........a.~.d.&.K.J.....r
0240 1b 71 02 62 61 d5 f5 19 c9 66 70 46 28 14 48 b1 13 17 21 1c 7e 3f ab 22 9d c1 c3 f8 c4 36 42 36 .q.ba....fpF(.H...!.~?.".....6B6
0260 70 8d ec 4e d3 06 da c6 91 2a 9c ce 14 7c f0 1c 4b e8 ed 73 26 c7 d3 87 77 b3 ce 53 04 50 75 49 p..N.....*...|..K..s&...w..S.PuI
0280 0f c7 b7 16 af 53 ed e4 bb c7 10 0c 9e b8 43 fa 9d 0b 87 7f 65 c2 a9 eb 55 2d 43 c7 e8 7a be 65 .....S........C.....e...U-C..z.e
02a0 9a f1 fb e7 d7 2c 8b fc 11 01 46 77 3e 94 ca f5 07 cd 43 56 f5 f5 2c 86 41 2d 25 51 f9 dc e4 5d .....,....Fw>.....CV..,.A-%Q...]
02c0 c0 bc 3f 60 4f 4b 12 48 89 ab f3 97 85 83 e0 63 e9 50 3b 55 ab c5 80 6a a5 43 58 d7 9b 36 50 b2 ..?`OK.H.......c.P;U...j.CX..6P.
02e0 96 8c d4 16 f6 0f b9 b2 49 96 e4 5a 20 cc 00 00 00 00 49 45 4e 44 ae 42 60 82 ........I..Z......IEND.B`.
>186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "test.h"

#include "log.h"
#include "nodedef.h"
#include "itemdef.h"
#include "gamedef.h"

content_t t_CONTENT_STONE;
content_t t_CONTENT_GRASS;
content_t t_CONTENT_TORCH;
content_t t_CONTENT_WATER;
content_t t_CONTENT_LAVA;
content_t t_CONTENT_BRICK;

////////////////////////////////////////////////////////////////////////////////

////
//// TestGameDef
////

class TestGameDef : public IGameDef {
public:
	TestGameDef();
	~TestGameDef();

	IItemDefManager *getItemDefManager() { return m_itemdef; }
	INodeDefManager *getNodeDefManager() { return m_nodedef; }
	ICraftDefManager *getCraftDefManager() { return m_craftdef; }
	ITextureSource *getTextureSource() { return m_texturesrc; }
	IShaderSource *getShaderSource() { return m_shadersrc; }
	ISoundManager *getSoundManager() { return m_soundmgr; }
	MtEventManager *getEventManager() { return m_eventmgr; }
	scene::ISceneManager *getSceneManager() { return m_scenemgr; }
	IRollbackManager *getRollbackManager() { return m_rollbackmgr; }
	EmergeManager *getEmergeManager() { return m_emergemgr; }

	scene::IAnimatedMesh *getMesh(const std::string &filename) { return NULL; }
	bool checkLocalPrivilege(const std::string &priv) { return false; }
	u16 allocateUnknownNodeId(const std::string &name) { return 0; }

	void defineSomeNodes();

private:
	IItemDefManager *m_itemdef;
	INodeDefManager *m_nodedef;
	ICraftDefManager *m_craftdef;
	ITextureSource *m_texturesrc;
	IShaderSource *m_shadersrc;
	ISoundManager *m_soundmgr;
	MtEventManager *m_eventmgr;
	scene::ISceneManager *m_scenemgr;
	IRollbackManager *m_rollbackmgr;
	EmergeManager *m_emergemgr;
};


TestGameDef::TestGameDef()
{
	m_itemdef = createItemDefManager();
	m_nodedef = createNodeDefManager();

	defineSomeNodes();
}


TestGameDef::~TestGameDef()
{
	delete m_itemdef;
	delete m_nodedef;
}


void TestGameDef::defineSomeNodes()
{
	IWritableItemDefManager *idef = (IWritableItemDefManager *)m_itemdef;
	IWritableNodeDefManager *ndef = (IWritableNodeDefManager *)m_nodedef;

	ItemDefinition itemdef;
	ContentFeatures f;

	//// Stone
	itemdef = ItemDefinition();
	itemdef.type = ITEM_NODE;
	itemdef.name = "default:stone";
	itemdef.description = "Stone";
	itemdef.groups["cracky"] = 3;
	itemdef.inventory_image = "[inventorycube"
		"{default_stone.png"
		"{default_stone.png"
		"{default_stone.png";
	f = ContentFeatures();
	f.name = itemdef.name;
	for(int i = 0; i < 6; i++)
		f.tiledef[i].name = "default_stone.png";
	f.is_ground_content = true;
	idef->registerItem(itemdef);
	t_CONTENT_STONE = ndef->set(f.name, f);

	//// Grass
	itemdef = ItemDefinition();
	itemdef.type = ITEM_NODE;
	itemdef.name = "default:dirt_with_grass";
	itemdef.description = "Dirt with grass";
	itemdef.groups["crumbly"] = 3;
	itemdef.inventory_image = "[inventorycube"
		"{default_grass.png"
		"{default_dirt.png&default_grass_side.png"
		"{default_dirt.png&default_grass_side.png";
	f = ContentFeatures();
	f.name = itemdef.name;
	f.tiledef[0].name = "default_grass.png";
	f.tiledef[1].name = "default_dirt.png";
	for(int i = 2; i < 6; i++)
		f.tiledef[i].name = "default_dirt.png^default_grass_side.png";
	f.is_ground_content = true;
	idef->registerItem(itemdef);
	t_CONTENT_GRASS = ndef->set(f.name, f);

	//// Torch (minimal definition for lighting tests)
	itemdef = ItemDefinition();
	itemdef.type = ITEM_NODE;
	itemdef.name = "default:torch";
	f = ContentFeatures();
	f.name = itemdef.name;
	f.param_type = CPT_LIGHT;
	f.light_propagates = true;
	f.sunlight_propagates = true;
	f.light_source = LIGHT_MAX-1;
	idef->registerItem(itemdef);
	t_CONTENT_TORCH = ndef->set(f.name, f);

	//// Water
	itemdef = ItemDefinition();
	itemdef.type = ITEM_NODE;
	itemdef.name = "default:water";
	itemdef.description = "Water";
	itemdef.inventory_image = "[inventorycube"
		"{default_water.png"
		"{default_water.png"
		"{default_water.png";
	f = ContentFeatures();
	f.name = itemdef.name;
	f.alpha = 128;
	f.liquid_type = LIQUID_SOURCE;
	f.liquid_viscosity = 4;
	f.is_ground_content = true;
	f.groups["liquids"] = 3;
	for(int i = 0; i < 6; i++)
		f.tiledef[i].name = "default_water.png";
	idef->registerItem(itemdef);
	t_CONTENT_WATER = ndef->set(f.name, f);

	//// Lava
	itemdef = ItemDefinition();
	itemdef.type = ITEM_NODE;
	itemdef.name = "default:lava";
	itemdef.description = "Lava";
	itemdef.inventory_image = "[inventorycube"
		"{default_lava.png"
		"{default_lava.png"
		"{default_lava.png";
	f = ContentFeatures();
	f.name = itemdef.name;
	f.alpha = 128;
	f.liquid_type = LIQUID_SOURCE;
	f.liquid_viscosity = 7;
	f.light_source = LIGHT_MAX-1;
	f.is_ground_content = true;
	f.groups["liquids"] = 3;
	for(int i = 0; i < 6; i++)
		f.tiledef[i].name = "default_lava.png";
	idef->registerItem(itemdef);
	t_CONTENT_LAVA = ndef->set(f.name, f);


	//// Brick
	itemdef = ItemDefinition();
	itemdef.type = ITEM_NODE;
	itemdef.name = "default:brick";
	itemdef.description = "Brick";
	itemdef.groups["cracky"] = 3;
	itemdef.inventory_image = "[inventorycube"
		"{default_brick.png"
		"{default_brick.png"
		"{default_brick.png";
	f = ContentFeatures();
	f.name = itemdef.name;
	for(int i = 0; i < 6; i++)
		f.tiledef[i].name = "default_brick.png";
	f.is_ground_content = true;
	idef->registerItem(itemdef);
	t_CONTENT_BRICK = ndef->set(f.name, f);
}

////
//// run_tests
////

bool run_tests()
{
	DSTACK(FUNCTION_NAME);

	u32 t1 = porting::getTime(PRECISION_MILLI);
	TestGameDef gamedef;

	g_logger.setLevelSilenced(LL_ERROR, true);

	u32 num_modules_failed     = 0;
	u32 num_total_tests_failed = 0;
	u32 num_total_tests_run    = 0;
	std::vector<TestBase *> &testmods = TestManager::getTestModules();
	for (size_t i = 0; i != testmods.size(); i++) {
		if (!testmods[i]->testModule(&gamedef))
			num_modules_failed++;

		num_total_tests_failed += testmods[i]->num_tests_failed;
		num_total_tests_run += testmods[i]->num_tests_run;
	}

	u32 tdiff = porting::getTime(PRECISION_MILLI) - t1;

	g_logger.setLevelSilenced(LL_ERROR, false);

	const char *overall_status = (num_modules_failed == 0) ? "PASSED" : "FAILED";

	rawstream
		<< "++++++++++++++++++++++++++++++++++++++++"
		<< "++++++++++++++++++++++++++++++++++++++++" << std::endl
		<< "Unit Test Results: " << overall_status << std::endl
		<< "    " << num_modules_failed << " / " << testmods.size()
		<< " failed modules (" << num_total_tests_failed << " / "
		<< num_total_tests_run << " failed individual tests)." << std::endl
		<< "    Testing took " << tdiff << "ms total." << std::endl
		<< "++++++++++++++++++++++++++++++++++++++++"
		<< "++++++++++++++++++++++++++++++++++++++++" << std::endl;

	return num_modules_failed;
}

////
//// TestBase
////

bool TestBase::testModule(IGameDef *gamedef)
{
	rawstream << "======== Testing module " << getName() << std::endl;
	u32 t1 = porting::getTime(PRECISION_MILLI);


	runTests(gamedef);

	u32 tdiff = porting::getTime(PRECISION_MILLI) - t1;
	rawstream << "======== Module " << getName() << " "
		<< (num_tests_failed ? "failed" : "passed") << " (" << num_tests_failed
		<< " failures / " << num_tests_run << " tests) - " << tdiff
		<< "ms" << std::endl;

	if (!m_test_dir.empty())
		fs::RecursiveDelete(m_test_dir);

	return num_tests_failed == 0;
}

std::string TestBase::getTestTempDirectory()
{
	if (!m_test_dir.empty())
		return m_test_dir;

	char buf[32];
	snprintf(buf, sizeof(buf), "%08X", myrand());

	m_test_dir = fs::TempPath() + DIR_DELIM "mttest_" + buf;
	if (!fs::CreateDir(m_test_dir))
		throw TestFailedException();

	return m_test_dir;
}

std::string TestBase::getTestTempFile()
{
	char buf[32];
	snprintf(buf, sizeof(buf), "%08X", myrand());

	return getTestTempDirectory() + DIR_DELIM + buf + ".tmp";
}


/*
	NOTE: These tests became non-working then NodeContainer was removed.
	      These should be redone, utilizing some kind of a virtual
		  interface for Map (IMap would be fine).
*/
#if 0
struct TestMapBlock: public TestBase
{
	class TC : public NodeContainer
	{
	public:

		MapNode node;
		bool position_valid;
		core::list<v3s16> validity_exceptions;

		TC()
		{
			position_valid = true;
		}

		virtual bool isValidPosition(v3s16 p)
		{
			//return position_valid ^ (p==position_valid_exception);
			bool exception = false;
			for(core::list<v3s16>::Iterator i=validity_exceptions.begin();
					i != validity_exceptions.end(); i++)
			{
				if(p == *i)
				{
					exception = true;
					break;
				}
			}
			return exception ? !position_valid : position_valid;
		}

		virtual MapNode getNode(v3s16 p)
		{
			if(isValidPosition(p) == false)
				throw InvalidPositionException();
			return node;
		}

		virtual void setNode(v3s16 p, MapNode & n)
		{
			if(isValidPosition(p) == false)
				throw InvalidPositionException();
		};

		virtual u16 nodeContainerId() const
		{
			return 666;
		}
	};

	void Run()
	{
		TC parent;

		MapBlock b(&parent, v3s16(1,1,1));
		v3s16 relpos(MAP_BLOCKSIZE, MAP_BLOCKSIZE, MAP_BLOCKSIZE);

		UASSERT(b.getPosRelative() == relpos);

		UASSERT(b.getBox().MinEdge.X == MAP_BLOCKSIZE);
		UASSERT(b.getBox().MaxEdge.X == MAP_BLOCKSIZE*2-1);
		UASSERT(b.getBox().MinEdge.Y == MAP_BLOCKSIZE);
		UASSERT(b.getBox().MaxEdge.Y == MAP_BLOCKSIZE*2-1);
		UASSERT(b.getBox().MinEdge.Z == MAP_BLOCKSIZE);
		UASSERT(b.getBox().MaxEdge.Z == MAP_BLOCKSIZE*2-1);

		UASSERT(b.isValidPosition(v3s16(0,0,0)) == true);
		UASSERT(b.isValidPosition(v3s16(-1,0,0)) == false);
		UASSERT(b.isValidPosition(v3s16(-1,-142,-2341)) == false);
		UASSERT(b.isValidPosition(v3s16(-124,142,2341)) == false);
		UASSERT(b.isValidPosition(v3s16(MAP_BLOCKSIZE-1,MAP_BLOCKSIZE-1,MAP_BLOCKSIZE-1)) == true);
		UASSERT(b.isValidPosition(v3s16(MAP_BLOCKSIZE-1,MAP_BLOCKSIZE,MAP_BLOCKSIZE-1)) == false);

		/*
			TODO: this method should probably be removed
			if the block size isn't going to be set variable
		*/
		/*UASSERT(b.getSizeNodes() == v3s16(MAP_BLOCKSIZE,
				MAP_BLOCKSIZE, MAP_BLOCKSIZE));*/

		// Changed flag should be initially set
		UASSERT(b.getModified() == MOD_STATE_WRITE_NEEDED);
		b.resetModified();
		UASSERT(b.getModified() == MOD_STATE_CLEAN);

		// All nodes should have been set to
		// .d=CONTENT_IGNORE and .getLight() = 0
		for(u16 z=0; z<MAP_BLOCKSIZE; z++)
		for(u16 y=0; y<MAP_BLOCKSIZE; y++)
		for(u16 x=0; x<MAP_BLOCKSIZE; x++)
		{
			//UASSERT(b.getNode(v3s16(x,y,z)).getContent() == CONTENT_AIR);
			UASSERT(b.getNode(v3s16(x,y,z)).getContent() == CONTENT_IGNORE);
			UASSERT(b.getNode(v3s16(x,y,z)).getLight(LIGHTBANK_DAY) == 0);
			UASSERT(b.getNode(v3s16(x,y,z)).getLight(LIGHTBANK_NIGHT) == 0);
		}

		{
			MapNode n(CONTENT_AIR);
			for(u16 z=0; z<MAP_BLOCKSIZE; z++)
			for(u16 y=0; y<MAP_BLOCKSIZE; y++)
			for(u16 x=0; x<MAP_BLOCKSIZE; x++)
			{
				b.setNode(v3s16(x,y,z), n);
			}
		}

		/*
			Parent fetch functions
		*/
		parent.position_valid = false;
		parent.node.setContent(5);

		MapNode n;

		// Positions in the block should still be valid
		UASSERT(b.isValidPositionParent(v3s16(0,0,0)) == true);
		UASSERT(b.isValidPositionParent(v3s16(MAP_BLOCKSIZE-1,MAP_BLOCKSIZE-1,MAP_BLOCKSIZE-1)) == true);
		n = b.getNodeParent(v3s16(0,MAP_BLOCKSIZE-1,0));
		UASSERT(n.getContent() == CONTENT_AIR);

		// ...but outside the block they should be invalid
		UASSERT(b.isValidPositionParent(v3s16(-121,2341,0)) == false);
		UASSERT(b.isValidPositionParent(v3s16(-1,0,0)) == false);
		UASSERT(b.isValidPositionParent(v3s16(MAP_BLOCKSIZE-1,MAP_BLOCKSIZE-1,MAP_BLOCKSIZE)) == false);

		{
			bool exception_thrown = false;
			try{
				// This should throw an exception
				MapNode n = b.getNodeParent(v3s16(0,0,-1));
			}
			catch(InvalidPositionException &e)
			{
				exception_thrown = true;
			}
			UASSERT(exception_thrown);
		}

		parent.position_valid = true;
		// Now the positions outside should be valid
		UASSERT(b.isValidPositionParent(v3s16(-121,2341,0)) == true);
		UASSERT(b.isValidPositionParent(v3s16(-1,0,0)) == true);
		UASSERT(b.isValidPositionParent(v3s16(MAP_BLOCKSIZE-1,MAP_BLOCKSIZE-1,MAP_BLOCKSIZE)) == true);
		n = b.getNodeParent(v3s16(0,0,MAP_BLOCKSIZE));
		UASSERT(n.getContent() == 5);

		/*
			Set a node
		*/
		v3s16 p(1,2,0);
		n.setContent(4);
		b.setNode(p, n);
		UASSERT(b.getNode(p).getContent() == 4);
		//TODO: Update to new system
		/*UASSERT(b.getNodeTile(p) == 4);
		UASSERT(b.getNodeTile(v3s16(-1,-1,0)) == 5);*/

		/*
			propagateSunlight()
		*/
		// Set lighting of all nodes to 0
		for(u16 z=0; z<MAP_BLOCKSIZE; z++){
			for(u16 y=0; y<MAP_BLOCKSIZE; y++){
				for(u16 x=0; x<MAP_BLOCKSIZE; x++){
					MapNode n = b.getNode(v3s16(x,y,z));
					n.setLight(LIGHTBANK_DAY, 0);
					n.setLight(LIGHTBANK_NIGHT, 0);
					b.setNode(v3s16(x,y,z), n);
				}
			}
		}
		{
			/*
				Check how the block handles being a lonely sky block
			*/
			parent.position_valid = true;
			b.setIsUnderground(false);
			parent.node.setContent(CONTENT_AIR);
			parent.node.setLight(LIGHTBANK_DAY, LIGHT_SUN);
			parent.node.setLight(LIGHTBANK_NIGHT, 0);
			core::map<v3s16, bool> light_sources;
			// The bottom block is invalid, because we have a shadowing node
			UASSERT(b.propagateSunlight(light_sources) == false);
			UASSERT(b.getNode(v3s16(1,4,0)).getLight(LIGHTBANK_DAY) == LIGHT_SUN);
			UASSERT(b.getNode(v3s16(1,3,0)).getLight(LIGHTBANK_DAY) == LIGHT_SUN);
			UASSERT(b.getNode(v3s16(1,2,0)).getLight(LIGHTBANK_DAY) == 0);
			UASSERT(b.getNode(v3s16(1,1,0)).getLight(LIGHTBANK_DAY) == 0);
			UASSERT(b.getNode(v3s16(1,0,0)).getLight(LIGHTBANK_DAY) == 0);
			UASSERT(b.getNode(v3s16(1,2,3)).getLight(LIGHTBANK_DAY) == LIGHT_SUN);
			UASSERT(b.getFaceLight2(1000, p, v3s16(0,1,0)) == LIGHT_SUN);
			UASSERT(b.getFaceLight2(1000, p, v3s16(0,-1,0)) == 0);
			UASSERT(b.getFaceLight2(0, p, v3s16(0,-1,0)) == 0);
			// According to MapBlock::getFaceLight,