Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2006:
[Freeciv-Dev] Re: assert(0) doesn't tell me enough
Home

[Freeciv-Dev] Re: assert(0) doesn't tell me enough

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: banjo <banjo@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: assert(0) doesn't tell me enough
From: Jason Dorje Short <jdorje@xxxxxxxxxxxx>
Date: Tue, 24 Jan 2006 11:18:31 -0500

banjo wrote:
Hey

With some of my rndCiv rulesets, the server dies with this message...

civserver: requirements.c:298: req_source_get_values: Assertion `0' failed.
Aborted

ok, i can read the code there.  But i need to know what caused the
failure. This would also be useful information for other ruleset writers.

The trouble is don't know c  well enough to add the necessary diagnostics.

Each of the 'assert(0);' lines needs to be able to report on what caused the failure. Or at least where the failure came from, where to start looking.

Note: the rulesets that cause this failure use the effects requirements in complex ways. In rndCiv you can generate a ruleset that'll cause this
failure with the command...

 ./rndCiv.pl 6 dwarf


So there's an error in the dwarf rulesets, but where?

Is this a valid building reqs?

reqs =
    { "type", "name", "range"
      "Tech", "Currency", "Player"
      "Building", "The Dwarves", "Player"
      "Building", "Mountain Hall", "City"
      "Terrain", "Mountains", "Adjacent"
      "Special", "Mine", "Adjacent"
    }

Assertions aren't supposed to fail. The bug here is that the error isn't caught when the ruleset is loaded.

-jason



[Prev in Thread] Current Thread [Next in Thread]