Commit Graph

335 Commits (82e674ddb849789b7018d417e74ea50440d66525)

Author SHA1 Message Date
Mark 8ece91193f ObjectInteractionMenu: UnitTest for QueryRejectDeparture, part2 2016-04-08 21:13:42 +02:00
Mark 16d0f263df ObjectInteractionMenu: Unit test for QueryRejectDeparture 2016-04-08 21:04:46 +02:00
Mark 2f472fce09 ObjectInteractionMenu: Prototype for transfer of liquid items. 2016-04-08 17:32:54 +02:00
Mark 8582dcf4c2 ObjectInteractionMenu: Test for transferring inventory to the same object.
This is a case that will usually not occur, but it may be useful for sorting stackable items in an object.
2016-04-08 17:15:31 +02:00
Mark 7be17fba71 ObjectInteractionMenu: Test for construction site 2016-04-07 17:29:14 +02:00
Mark 43f42dcf7f ObjectInteractionMenu: Unit test for transferring objects with extra slots 2016-04-07 06:40:48 +02:00
Mark 020b3fa9af Expanded test to other sources 2016-04-06 21:25:37 +02:00
Mark b62acf2c8d ObjectInteractionMenu: Unit test for single arrows getting stacked
This revealed a bug: Transferring single arrows to the surrounding with the "transfer all button" leaves single arrows in the environment, instead of actual stacks.
Transferring them with single clicks stacks the arrows though.
2016-04-06 21:05:17 +02:00
Mark 49be2c63fd ObjectInteractionMenu: Fixed unit tests.
The trick was that the Clonk does not exit the object right away, but gets a drop command instead. Furthermore, it was confusing that the Collection2-callback never actually happens in this situation.
2016-04-06 20:43:09 +02:00
Mark 9a24838e78 ObjectInteractionMenu: Repeat first test for different sources 2016-04-06 17:07:45 +02:00
Mark 7293c23cf5 ObjectInteractionMenu: Added unit test 2016-04-06 06:55:06 +02:00
Mark 1c1ea38efa Renamed the liquids IDs
Omitted the prefix "Liquid_".
2016-03-25 19:11:55 +01:00
Mark c0b783c976 Power: Fix unit test 20 2016-03-25 16:13:11 +01:00
Mark 74ce1ea8ac Stackable: Unit test for barrel entering Clonks via interaction menu 2016-03-25 15:16:03 +01:00
Mark 9298d27719 Producers: New test for collection 2016-03-24 22:04:53 +01:00
Mark 1f25fa2679 Producers: Additional unit tests 2016-03-24 21:20:49 +01:00
Mark e3a991bb86 Producers: Additional unit tests 2016-03-24 20:45:48 +01:00
Mark 898530ed37 Producers: Additional unit tests 2016-03-24 19:40:34 +01:00
Mark 9645b4afe9 Producers: Additional unit tests 2016-03-24 19:17:21 +01:00
Mark fc3d6a69f0 Producers: More unit tests for basic operation
Added tests for adding to the queue and clearing the queue. The other tests are dummies for now. Found out that the parameter 'abort' in ClearQueue() was never used.
2016-03-24 18:27:23 +01:00
Mark 18ad5894e2 Producers: Producers can convert ice to water
This special case is a relic, because I do not know whether this is actually a use case that is required in a scenario. All unit tests in the producers test pass now.
2016-03-24 16:19:15 +01:00
Mark 8298bc789f Producers: Unit test for continued production
Made test 7 more specific: Production must be halted, material must stay.
2016-03-19 11:49:50 +01:00
Mark 3ad6cb2177 Producers: Unit test for halted production 2016-03-19 11:41:49 +01:00
Mark 274379ddc3 Producers: Fixed unit test 5
Added unit test 6 for fuel objects that do not behave correctly. Fuel should always return the current fuel amount if not parameter is passed.
2016-03-18 17:44:51 +01:00
Mark 1d8163e3f2 Producers: Unit tests for fuel objects 2016-03-18 17:18:33 +01:00
Mark a224d62791 Stackable: Unit test for initialization
The earth object did not include _inherited(...) in the Construction() callback. Thus it was not initialized as a stackable object correctly. Fortunately the other stackable objects did not have this problem.
Nonetheless I added a unit test, so that we can identify similar problems in the future.
2016-03-18 06:30:16 +01:00
Mark 992c3cd074 Producers: Modified unit test 2016-03-17 22:43:31 +01:00
Mark a24ec9f0ac Producers: Basic unit test 2016-03-17 21:51:35 +01:00
Mark 49fdd59362 Refactoring: Stackable: Moved callback CollectFromStack()
The callback happens in every call to MergeWithStacksIn() now, instead of RejectEntrance(). Otherwise the following use case does not work: Liquid enters crew/building and fills the contained barrels. Added a unit test for that use case. Stackable unit tests still pass.
2016-03-17 18:43:08 +01:00
Mark a2700890ce Refactoring: Unit test for liquid containers uses doTest()
This is more readable and failures can be identified more easily.
2016-03-17 18:13:40 +01:00
Mark 8749300622 Fix unit tests: Some code adjustments were forgotten in the other commits. 2016-03-16 22:44:48 +01:00
Mark ac8d40418c Refactoring: Stackable: Renamed TryPutInto() to MergeWithStacksIn()
The previous name suggested that the object actually gets put into another object. In fact it merges the stack count with other stacks, and it does not only try to (and reverts the state if it fails), but it actually changes other objects even if the function returns false.
2016-03-16 18:19:55 +01:00
Mark a61eac6ff3 Refactoring: Stackable: Reenabled recursive stacking into items
This got removed by accidet (checking if the object was added to another stack seemed logical). However, this whole function does not really make sense. It returns true if the object got removed only. That means that the object would not enter the other object anyway.
Removed the UpdateStackDisplay(), because that happens in TryAddToStack() if the count changes, anyway.
2016-03-11 07:03:22 +01:00
Mark b40e44340c Stackable: Reverted some tests.
Checked the tests against the original implementation. Turns out that the implementation was recursive for finite stacks after all!
2016-03-10 17:41:22 +01:00
Mark 0759c59bf1 Stackable: Fixed remaining unit tests 2016-03-10 17:29:42 +01:00
Mark 2e8ed77f56 Stackable: Fixed unit test 17
The test simply had a wrong expectation.
2016-03-10 17:20:45 +01:00
Mark 862c4ad312 Stackable: Fixed unit test 12 and 13
The test expects what the method does. Added original expected behavior in comments, because this was the use case example.
2016-03-10 07:03:29 +01:00
Mark f0aa3fafc7 Stackable: Fix unit test 8
The test now expects what the functions actually do. Put the previously expected behavior in comments
2016-03-10 06:56:05 +01:00
Mark 674145dc48 Refactoring: Stackable: Fix unit test 5
Added documentation for Stack(); Stack() does not stack on top of itself anymore.
2016-03-10 06:41:34 +01:00
Mark 114ad2697e Refactoring: Stackable: A stack can never contain 0 items
Stacks with 0 or less items are always removed. GetStackCount() returns the actual stack count now, which should always be positive.
2016-03-09 06:59:46 +01:00
Mark b16e94d51d Stackable: Unit test for use case #2 with infinite objects 2016-03-09 06:30:49 +01:00
Mark 2dd6bbdaf4 Stackable: More unit tests for infinite object 2016-03-08 22:53:27 +01:00
Mark 350088525c Refactoring: Stackable: Use InitialStackCount() where it makes sense 2016-03-08 06:57:53 +01:00
Mark d8a68f5655 Stackable: Unit test for stacking finite and infinite objects 2016-03-08 06:48:34 +01:00
Mark fe5e1bc581 Stackable: Unit test for infinite stack count, basics.
Found a bug: An infinite stack gets removed if you take the entire stack at once.
2016-03-07 17:47:49 +01:00
Mark 45fbc64254 Stackable: Remove obsolete objects. 2016-03-07 06:53:08 +01:00
Mark c7fc982d3e Stackable: Unit tests for the use cases from the stackable documentation. 2016-03-07 06:40:27 +01:00
Mark 8573ed9745 Stackable: Unit test for deeply nested extra-slot objects 2016-03-07 06:13:44 +01:00
Mark df04c2c9c1 Stackable: Unit test 9
Stack objects into a container with non-extra-slot containers.
2016-03-06 21:44:57 +01:00
Mark 4101dc7600 Stackable: Additional test scenarios for unit test 8 2016-03-06 21:30:57 +01:00
Mark d86fe2549d Stackable: Unit test for TryPutInto() with empty containers.
First part of a series of tests. TryPutInto() has to be tested with several container types.
2016-03-06 21:04:28 +01:00
Mark e92f5b6bf9 Stackable: Better logging in unit test
Also corrected some minor details in the test logic, related to InitialStackCount() and MaxStackCount().
2016-03-06 06:49:57 +01:00
Mark 258f3d3b3b Stackable: Unit tests for Stack() and TryAddToStack() 2016-03-04 17:46:24 +01:00
Mark ec35a11013 Stackable: More unit tests
Tests for CalcValue() and TakeObject(). Testing the behaviour in combination with containers that have an extra slot is necessary.
2016-03-04 06:57:47 +01:00
Mark e8b6fda751 Stackable: Unit test
First unit tests for the stackable library
2016-03-03 23:01:52 +01:00
Mark 96e59a0626 Failed attempt at unit test nr. 6 2016-03-03 22:10:10 +01:00
Mark 3c05d53b3a Liquid objects: Added unit test 5 2016-03-03 17:20:58 +01:00
Mark 1786f5b3d9 Liquid objects: Fix unit test, Stackable
Addedv debugging logs, will remove them once all unit tests work. The stackable library function "TryPutInto" was changed slightly.
2016-03-03 17:10:43 +01:00
Mark a7ed516c39 Refactoring: Liquid container
The liquid container library was severely reduced by the changes that the liquid objects bring. The remaining unit tests nearly work.
2016-03-01 22:29:35 +01:00
Mark 0a77b58b6a Steam Engine: Use fuel as liquid, finished
The pump was blocked, because the steam engine did not insert enough material
2016-02-27 14:35:38 +01:00
Mark 7894fb0fc6 Steam Engine: Use fuel liquid, Work in progress 2016-02-27 12:41:46 +01:00
Mark 351e61832c Liquid Container: Fixed liquid objects remaining in existence after test. 2016-02-26 22:38:38 +01:00
Mark 55401f88e3 Liquid object: Fixed unit test 12
Added test for filling an empty barrel partially
2016-02-26 15:42:54 +01:00
Mark 79df36eb6b Liquid object: Refactored object entering system.
Unit test 3 still fails, because the functions are not runtime overloadable. Test 12 fails, because liquid transfer does not work correctly yet. This fill be fixed in the next checkin.

Added debug logging, this has to be removed again later.
2016-02-26 15:19:41 +01:00
Mark af6a31c489 Merge remote-tracking branch 'master' into liquid_container 2016-02-20 21:17:59 +01:00
Mark 862e69655e Liquid object: Test for liquid leaving the container 2016-02-20 21:10:41 +01:00
Mark 7cc88bd909 Liquid Object: Simplified transfer into liquid container.
Unfortunately, now the object is not actually transferred, but removed, and a new one is created or an existing one is filled in the liquid container. The logic could use a rework actually, because everything was more clear when the container stored things in variables.
2016-02-20 21:00:48 +01:00
Mark 9e46d752a9 Liquid Object: Unit test for entering liquid containers
The tests handles the entrance of liquid objects into the container. Will look to simplify the script in the next commit.
2016-02-20 20:14:19 +01:00
Maikel de Vries 46e18f5f9f kill tracing: add test for bomb arrow tumble kill 2016-02-19 22:13:09 +01:00
Mark 8c578931bb Liquid Object: Replaced liquid container logic
The liquid container now stores liquid objects, instead of volume and liquid type. Liquid objects can have be of a specific type, such as Liquid_Water, Liquid_Oil, etc..., but they can also just stay Library_Liquid for other liquids.
The liquid container logic has become more complex now, but still works as before. Transferring liquids to other objects may still need some improvements:
- at the moment, transferring liquids between liquid containers is possible
- maybe liquids objects, such as oil, can enter a liquid container while another liquid is in that container already - will need a unit test for that
- transferring liquid from a liquid container to a structure or crew member should be possible (but is not yet), if the target is not a liquid container but contains liquid containers
2016-02-19 06:53:44 +01:00
Mark 1dbb81554d Refactoring: Removed the flagpole from power system test #21 2016-02-16 21:07:50 +01:00
Mark 6f7152eba6 Fixed bug in barrel stacking and added a unit test for this use case 2016-02-16 21:07:31 +01:00
Mark 1f54927aee Unit test for line connections 2016-02-16 21:04:11 +01:00
Mark be8fd0833c Oil-burning steam engine
The steam engine can burn oil as fuel now. Added test to power system unit test. Still needs support for actually getting oil into the engine.
Fixed a bug in LiquidContainer that would return no liquid if the entire contents are removed. Added unit test for said bug.
Fixed overspilling of connected liquid containers. Pump no longer counts as a liquid container/tank, so that it still spills liquid if no drain is connected.
2016-02-16 21:04:06 +01:00
Mark a0fb0473b3 Barrels function as fuel now.
The steam engine does not remove the barrels, it just empties them. Made power system unit test 19 end if both pumps are pumping, this seems to be the intention of the unit test. Added power system unit test 20: Steam engine fueled by oil barrels.
2016-02-16 21:04:01 +01:00
Mark 611655a9ce Removed comments 2016-02-16 21:03:38 +01:00
Mark 2099146839 Adjusted unit test so that it works with the new interface 2016-02-16 21:03:34 +01:00
Mark 371fdaeaa6 Refactoring: Pump interface names
The pump uses the same function names as the liquid tank now. This is a preparation for the consolidation of the two.
2016-02-16 21:02:56 +01:00
Mark fbdd5eeb09 Refactoring: Pimp, Pipe, SteamEngine
Now it is possible to connect lines from a pump to the steam engine. This is achieved by the steam engine being a liquid tank. It did not seem good to allow connection from pumps to all liquid containers (i.e. barrels). A liquid tank is also a liquid container, they share the same interface, but it is also a structure.

It is not yet possible to fill the steam engine with any liquid though, because it is not defined what kind of liquid it accepts. This will be oil in the future. Furthermore, the behaviour when the pump adds incompatible liquid is not defined yet.
2016-02-16 21:02:28 +01:00
Mark 6f557520e8 Refactoring: Renamed Set/GetLiquidName to Set/GetLiquidType 2016-02-16 21:02:09 +01:00
Mark 9d17cff91e Refactoring: Removed old barrel functions
Replaced old barrel functions with the liquid container library calls
2016-02-16 21:01:59 +01:00
Mark 2f5cc035b6 Library: Liquid Container
Added unit test.
2016-02-16 21:01:55 +01:00
Maikel de Vries 04877e33da do not test permeable solid mask on the elevator case in master
This messes up so many things as one could have expected. Instead we do the sensible thing and enable it only in the test scenario. For future reference all sequences involving an elevator and NPC clonks are broken with this feature.
2016-02-08 15:27:58 +01:00
Maikel de Vries 2000f741c3 kill tracing: fix relaunching tests 2016-02-01 22:02:09 +01:00
Maikel de Vries c2131ee122 kill tracing: reduce code duplication in tests 2016-02-01 21:21:30 +01:00
Maikel de Vries 00b43d3d60 kill tracing: add test for blasting free objects 2016-02-01 21:21:30 +01:00
Maikel de Vries ce6cbc1cf6 add more kill tracing tests 2016-01-29 18:56:09 +01:00
Maikel de Vries 8cabf67845 clean up tests: remove Teams.txt fix some titles 2016-01-20 19:44:28 +01:00
Maikel de Vries db9e3aa133 remove grapple bow test
Seems to be outdated and can be tested in rope test
2016-01-20 19:30:33 +01:00
Maikel de Vries ac122e4aa3 remove pump test scenario
Does not do anything and the pump is sufficiently tested in the power test.
2016-01-20 19:23:12 +01:00
Clonkonaut 7538a5bd12 Added simple testing scenario for permeable solid masks.
In there, it's also activated for basements and bridges.
2016-01-20 19:17:45 +01:00
Maikel de Vries 775746d78d fix power system tests (due to object changes) 2016-01-20 12:07:46 +01:00
Mark 8719ee8b58 Test scenario for SetGraphics()
Scenario that tests SetGraphics() in various ways: Setting graphics of meshes/sprites to other objects, overlaying objects onto other objects.
The scenario is not in the Issues.ocf folder, because it addresses multiple issues #1458 and #1538 and the status of the issues has not been acknowledged yet.
2016-01-07 19:09:18 +01:00
Maikel de Vries 7b4fe4452f killtracing: more tests and more precise test descriptions 2016-01-05 18:19:49 +01:00
Maikel de Vries af4819aa81 killtracing: add additional tests 2016-01-03 20:18:06 +01:00
Maikel de Vries 471470f1fb killtracing: more tests 2016-01-03 14:39:24 +01:00
Maikel de Vries d6a16f7ff1 killtracing: more tests and overview table 2016-01-03 13:30:11 +01:00
Maikel de Vries 5ba7519b79 killtracing: add test scenario 2016-01-03 09:57:06 +01:00
Armin Burgmeier 0538d1e57f Fix the planet/Tests.ocf/ColorfulLights.ocs test scenario
The TexMap.txt was outdated
2016-01-01 22:28:22 -08:00
Armin Burgmeier 9b9d9e378f Fix PXSAndSmoke.ocs test scenario
It contained an outdated TexMap.
2016-01-01 22:28:21 -08:00