Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2001:
[Freeciv-Dev] server sanity checking
Home

[Freeciv-Dev] server sanity checking

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] server sanity checking
From: Thue <thue@xxxxxxx>
Date: Sun, 18 Feb 2001 22:57:41 +0100

This implements a function sanity_check() which consistency-checks a number 
of things in the server. It is called once a turn, but is also nice to have 
when you are coding a function and want to see if the function messes things 
up. It gives a nice failed assert when something goes wrong, so there better 
not be many bugs :). The call to the function looks like 
#if (IS_DEVEL_VERSION || IS_BETA_VERSION)
    sanity_check();
#endif
So we don't segfault "production versions".
I have added what checks I could think of off the top of my heads; feel free 
to add more.
This would have caught the "railroad without roads" bug Christian Knoke 
reported the turn after it occured.
There is also a check for the city available squares getting out of date (bug 
reported by christion Knoke), but 1) this happens _very_ often, 2) we know 
what causes it, so this is deffed out until that bug is fixed.

-Thue

Attachment: sanity.diff.bz2
Description: BZip2 compressed data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] server sanity checking, Thue <=