Up to Main Index                              Up to Journal for July, 2019

                     JOURNAL FOR SATURDAY 6TH JULY, 2019

SUBJECT: Hedges, dust bunnies and testing
   DATE: Sat  6 Jul 15:39:35 BST 2019

With the recent nice weather I’ve had less time to spend on WolfMUD due to the
garden needing some serious attention. Deforestation would probably be more
appropriate. Tomorrow I have hedge trimming planned. With the hedge being 50ft
long and 9ft high it usually takes me, on my own, all day going up and down
ladders :(

I also lost a bucket load of time this week after one of my machines went on
the fritz and need sorting out. With the recent warm weather the i7 CPU kept
overheating under load and was being throttled. Stripping down the machine and
evicting all of the dust bunnies did the trick and the machine now detects
three fans again instead of just two — the missing fan being in the front of
the case sucking in air. Although I’m not sure that fan actually does much due
to bad case design — the fan is right up against the hard drive cage with
nowhere for the air to go — it can’t even flow through the cage and over the
hard drives to cool them…

Under max load the CPU now hits 75°C instead of over 100°C which caused the
throttling. When idle the CPU is now as low as 30-34°C in a room that’s around
26-28°C most of the time.

On to WolfMUD. After a lot of work I have finally pushed out the tests for the
GET command. You would think it’s easy:

  GET command testing:
   - Check messages to actor and observers are correct
   - Check clean up and action events are cancelled on pick up
   - Check items moved between location and actor’s inventory
   - Check spawned items move a copy from location to actor’s inventory
   - Check vetoes work correctly

Then you have to bear in mind that the commands actually need an environment,
a world with locations and items in, to be able to function correctly so that
they can be tested. I’ve tried to keep the tests as simple as possible — the
last thing you want it complex and buggy tests. After many iterations the GET
command with comments is 109 lines of code and the tests come in at 363 lines.

Test coverage for the GET command is 100%.

To help simplify some tests I’ve added a Pending method to the Action, Cleanup
and Reset events. The tests can then use an interface{ Pending() bool } when
testing events. This is part of a larger piece of work that needs to be
carried out to unify events with a common interface. However, I’ve resisted
the urge to work on that problem right now.

Next up will be writing the tests for the DROP command. Progress should be
quicker now that the GET command is done and I have something to work from. I
plan to start this evening — this afternoon there is a pile of ironing that
isn’t going to do itself…


  Up to Main Index                              Up to Journal for July, 2019