[sldev] what and/or where is TEST_HARNESS?
Lawson English
lenglish5 at cox.net
Sat Sep 1 23:15:10 PDT 2007
Hey all, I found a bit of code at the end of llcontrol.cpp
I was wondering if any Linden has the missing definitions that enable
this code and could 1) tell me what it does and 2) furnish me with a
copy. SEEMS like it would be helpful in designing a viable windows
class so that we can prototype GUI and related stuff without having to
deal with the client or the login panel. Even the login panel
establishes contact with the webserver and downloads the splash image
and latest blog URLs which takes up waay too much time.
As well, by being able to deal with the GUI framework on a hello world
level, we can make a serious stab at upgrading the GUI framework and
eventually port the client-specific code back to the improved version of
the framework.
Division of labor and all that.
#ifdef TEST_HARNESS
void main()
{
F32_CONTROL foo, getfoo;
S32_CONTROL bar, getbar;
BOOL_CONTROL baz;
U32 count = gGlobals.loadFromFile("controls.ini");
llinfos << "Loaded " << count << " controls" << llendl;
// test insertion
foo = new LLControl<F32>("gFoo", 5.f, 1.f, 20.f);
gGlobals.addEntry("gFoo", foo);
bar = new LLControl<S32>("gBar", 10, 2, 22);
gGlobals.addEntry("gBar", bar);
baz = new LLControl<BOOL>("gBaz", FALSE);
gGlobals.addEntry("gBaz", baz);
// test retrieval
getfoo = (LLControl<F32>*) gGlobals.resolveName("gFoo");
getfoo->dump();
getbar = (S32_CONTROL) gGlobals.resolveName("gBar");
getbar->dump();
// change data
getfoo->set(10.f);
getfoo->dump();
// Failure modes
// ...min > max
// badfoo = new LLControl<F32>("gFoo2", 100.f, 20.f, 5.f);
// ...initial > max
// badbar = new LLControl<S32>("gBar2", 10, 20, 100000);
// ...misspelled name
// getfoo = (F32_CONTROL) gGlobals.resolveName("fooMisspelled");
// getfoo->dump();
// ...invalid data type
getfoo = (F32_CONTROL) gGlobals.resolveName("gFoo");
getfoo->set(TRUE);
getfoo->dump();
// ...out of range data
// getfoo->set(100000000.f);
// getfoo->dump();
// Clean Up
delete foo;
delete bar;
delete baz;
}
#endif
BOOL control_insert_before( LLControlBase* first, LLControlBase* second )
{
return ( first->getName().compare(second->getName()) < 0 );
}
More information about the SLDev
mailing list