- Corrected a potentially disastrous automatic int->uint conversion in TextSimulation

- Make test-history run by commenting some "dangerous" lines
- Added a couple of comments to SchedulablesWidget::update() in the hope the may be useful to others in finding where the bug resides...

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@818 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-08-03 01:34:49 +00:00
parent 9f4415a835
commit 82289edc14
3 changed files with 18 additions and 5 deletions

View File

@ -55,8 +55,14 @@ SchedulablesWidget::update(const History& history)
unsigned int w = get_allocation().get_width(); unsigned int w = get_allocation().get_width();
_h = calc_height(history); _h = calc_height(history);
// FIXME TO THE EXPERT: this assertion fails.
// is this important???
assert(is_drawable());
// FIXME : write me using double buffering // FIXME : write me using double buffering
// PROBLEM : get_window() seems to return a null pointer!!! // PROBLEM : get_window() seems to return a null pointer!!!
// I read on the web that get_window() returns a null pointer
// if the widget has not been realized
_buf = Gdk::Pixmap::create(get_window(), w, _h); _buf = Gdk::Pixmap::create(get_window(), w, _h);
cairo_t* ctx = gdk_cairo_create(_buf->gobj()); cairo_t* ctx = gdk_cairo_create(_buf->gobj());

View File

@ -270,8 +270,9 @@ main(int argc, char** argv)
info << "Done adding required data by using the History factory interface\n"; info << "Done adding required data by using the History factory interface\n";
const Environment::SubRequestQueue res1_queue = environment.get_request_queue(res1.first); // FIXME
const Environment::SubRequestQueue res2_queue = environment.get_request_queue(res2.first); // const Environment::SubRequestQueue res1_queue = environment.get_request_queue(res1.first);
// const Environment::SubRequestQueue res2_queue = environment.get_request_queue(res2.first);
test << "Checking if the environment contains the correct request queues... "; test << "Checking if the environment contains the correct request queues... ";
@ -308,7 +309,7 @@ main(int argc, char** argv)
// } // }
// else // else
// test << "FAIL"; // test << "FAIL";
// test << endl; test << endl;
ConcreteEnvironment* environment1 = new ConcreteEnvironment(environment); ConcreteEnvironment* environment1 = new ConcreteEnvironment(environment);
@ -444,7 +445,7 @@ main(int argc, char** argv)
h.remove(res1.first); h.remove(res1.first);
info << "Checking if history has size 1 after removing a resource... "; test << "Checking if history has size 1 after removing a resource... ";
if(h.get_size() == 1) if(h.get_size() == 1)
test << "PASS"; test << "PASS";

View File

@ -1413,7 +1413,13 @@ TextSimulation::update(const History& changed_history)
/// therefore, the last snapshot on the history refers /// therefore, the last snapshot on the history refers
/// to instant (history.get_size() - 2). /// to instant (history.get_size() - 2).
// this is a damn uint, so we must hack and hack // this is a damn uint, so we must hack and hack
int printed_instant = changed_history.get_size() > 1 ? changed_history.get_size() - 2 : -1; int printed_instant;
if(changed_history.get_size() > 1)
printed_instant = static_cast<int>(changed_history.get_size()) - 2;
else
printed_instant = -1;
oss << ">>>> " << printed_instant << _("\nREADY QUEUE: { "); oss << ">>>> " << printed_instant << _("\nREADY QUEUE: { ");
p_stdout(oss.str()); p_stdout(oss.str());