summaryrefslogtreecommitdiff
path: root/indra/integration_tests/llui_libtest
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2009-06-22 15:02:19 -0700
committerBryan O'Sullivan <bos@lindenlab.com>2009-06-22 15:02:19 -0700
commitbaa73fddd9287ddafd2d31551cb253b355ed910a (patch)
treee3f0986617fe6c0ee0a14df6aac13c6bb6f92507 /indra/integration_tests/llui_libtest
parentdc3833f31b8a20220ddb1775e1625c016c397435 (diff)
parentfcaa1ad46fd1df4cfec9dee12caf6e7b5bf32136 (diff)
Merge with viewer-2.0.0-3 branch
Diffstat (limited to 'indra/integration_tests/llui_libtest')
-rw-r--r--indra/integration_tests/llui_libtest/CMakeLists.txt1
-rw-r--r--indra/integration_tests/llui_libtest/llui_libtest.cpp57
-rw-r--r--indra/integration_tests/llui_libtest/llwidgetreg.cpp77
-rw-r--r--indra/integration_tests/llui_libtest/llwidgetreg.h2
4 files changed, 92 insertions, 45 deletions
diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt
index 71a47f1475..68556ac4ab 100644
--- a/indra/integration_tests/llui_libtest/CMakeLists.txt
+++ b/indra/integration_tests/llui_libtest/CMakeLists.txt
@@ -62,6 +62,7 @@ endif (DARWIN)
target_link_libraries(llui_libtest
llui
${OS_LIBRARIES}
+ ${GOOGLE_PERFTOOLS_LIBRARIES}
)
if (WINDOWS)
diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp
index 599bcabfcb..f8caa7990b 100644
--- a/indra/integration_tests/llui_libtest/llui_libtest.cpp
+++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp
@@ -51,6 +51,53 @@
// *TODO: switch to using TUT
// *TODO: teach Parabuild about this program, run automatically after full builds
+// We can't create LLImageGL objects because we have no window or rendering
+// context. Provide enough of an LLUIImage to test the LLUI library without
+// an underlying image.
+class TestUIImage : public LLUIImage
+{
+public:
+ TestUIImage()
+ : LLUIImage( std::string(), NULL ) // NULL ImageGL, don't deref!
+ { }
+
+ /*virtual*/ S32 getWidth() const
+ {
+ return 16;
+ }
+
+ /*virtual*/ S32 getHeight() const
+ {
+ return 16;
+ }
+};
+
+// We need to supply dummy images
+class TestImageProvider : public LLImageProviderInterface
+{
+public:
+ /*virtual*/ LLPointer<LLUIImage> getUIImage(const std::string& name)
+ {
+ return makeImage();
+ }
+
+ /*virtual*/ LLPointer<LLUIImage> getUIImageByID(const LLUUID& id)
+ {
+ return makeImage();
+ }
+
+ /*virtual*/ void cleanUp()
+ {
+ }
+
+ LLPointer<LLUIImage> makeImage()
+ {
+ LLPointer<LLImageGL> image_gl;
+ LLPointer<LLUIImage> image = new LLUIImage( std::string(), image_gl);
+ return image;
+ }
+};
+
static std::string get_xui_dir()
{
std::string delim = gDirUtilp->getDirDelimiter();
@@ -84,8 +131,9 @@ int main(int argc, char** argv)
settings["floater"] = &floater_group;
settings["ignores"] = &ignores_group;
- LLImageProviderInterface* image_provider = NULL;
- LLUI::initClass(settings, image_provider);
+ // Don't use real images as we don't have a GL context
+ TestImageProvider image_provider;
+ LLUI::initClass(settings, &image_provider);
const bool no_register_widgets = false;
LLWidgetReg::initClass( no_register_widgets );
@@ -116,7 +164,7 @@ int main(int argc, char** argv)
// Convert all test floaters to new XML format
std::string delim = gDirUtilp->getDirDelimiter();
- std::string xui_dir = get_xui_dir() + "en-us" + delim;
+ std::string xui_dir = get_xui_dir() + "en" + delim;
std::string filename;
while (gDirUtilp->getNextFileInDir(xui_dir, "floater_test_*.xml", filename, false))
{
@@ -141,8 +189,7 @@ int main(int argc, char** argv)
llinfos << "Output: " << out_filename << llendl;
LLFILE* floater_file = LLFile::fopen(out_filename.c_str(), "w");
LLXMLNode::writeHeaderToFile(floater_file);
- const char* const indent = " ";
- output_node->writeToFile(floater_file, indent);
+ output_node->writeToFile(floater_file);
fclose(floater_file);
}
return 0;
diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.cpp b/indra/integration_tests/llui_libtest/llwidgetreg.cpp
index f4a4665cc5..417f3059d6 100644
--- a/indra/integration_tests/llui_libtest/llwidgetreg.cpp
+++ b/indra/integration_tests/llui_libtest/llwidgetreg.cpp
@@ -62,46 +62,45 @@ void LLWidgetReg::initClass(bool register_widgets)
// references to the object files.
if (register_widgets)
{
- LLRegisterWidget<LLButton> button("button");
- LLRegisterWidget<LLCheckBoxCtrl> check_box("check_box");
- LLRegisterWidget<LLComboBox> combo_box("combo_box");
- LLRegisterWidget<LLFlyoutButton> flyout_button("flyout_button");
- LLRegisterWidget<LLContainerView> container_view("container_view");
- LLRegisterWidget<LLIconCtrl> icon("icon");
- LLRegisterWidget<LLLineEditor> line_editor("line_editor");
- LLRegisterWidget<LLSearchEditor> search_editor("search_editor");
- LLRegisterWidget<LLMenuItemSeparatorGL> menu_item_separator("menu_item_separator");
- LLRegisterWidget<LLMenuItemCallGL> menu_item_call_gl("menu_item_call");
- LLRegisterWidget<LLMenuItemCheckGL> menu_item_check_gl("menu_item_check");
- LLRegisterWidget<LLMenuGL> menu("menu");
- LLRegisterWidget<LLMenuBarGL> menu_bar("menu_bar");
- LLRegisterWidget<LLContextMenu> context_menu("context_menu");
- LLRegisterWidget<LLMultiSlider> multi_slider_bar("multi_slider_bar");
- LLRegisterWidget<LLMultiSliderCtrl> multi_slider("multi_slider");
- LLRegisterWidget<LLPanel> panel("panel", &LLPanel::fromXML);
- LLRegisterWidget<LLLayoutStack> layout_stack("layout_stack", &LLLayoutStack::fromXML);
- LLRegisterWidget<LLProgressBar> progress_bar("progress_bar");
- LLRegisterWidget<LLRadioGroup> radio_group("radio_group");
- LLRegisterWidget<LLRadioCtrl> radio_item("radio_item");
- LLRegisterWidget<LLScrollContainer> scroll_container("scroll_container");
- LLRegisterWidget<LLScrollingPanelList> scrolling_panel_list("scrolling_panel_list");
- LLRegisterWidget<LLScrollListCtrl> scroll_list("scroll_list");
- LLRegisterWidget<LLSlider> slider_bar("slider_bar");
- LLRegisterWidget<LLSlider> volume_slider("volume_slider");
- LLRegisterWidget<LLSliderCtrl> slider("slider");
- LLRegisterWidget<LLSpinCtrl> spinner("spinner");
- LLRegisterWidget<LLStatBar> stat_bar("stat_bar");
- //LLRegisterWidget<LLPlaceHolderPanel> placeholder("placeholder");
- LLRegisterWidget<LLTabContainer> tab_container("tab_container");
- LLRegisterWidget<LLTextBox> text("text");
- LLRegisterWidget<LLTextEditor> simple_text_editor("simple_text_editor");
- LLRegisterWidget<LLUICtrl> ui_ctrl("ui_ctrl");
- LLRegisterWidget<LLStatView> stat_view("stat_view");
- //LLRegisterWidget<LLUICtrlLocate> locate("locate");
- //LLRegisterWidget<LLUICtrlLocate> pad("pad");
- LLRegisterWidget<LLViewBorder> view_border("view_border");
+ LLDefaultWidgetRegistry::Register<LLButton> button("button");
+ LLDefaultWidgetRegistry::Register<LLCheckBoxCtrl> check_box("check_box");
+ LLDefaultWidgetRegistry::Register<LLComboBox> combo_box("combo_box");
+ LLDefaultWidgetRegistry::Register<LLFlyoutButton> flyout_button("flyout_button");
+ LLDefaultWidgetRegistry::Register<LLContainerView> container_view("container_view");
+ LLDefaultWidgetRegistry::Register<LLIconCtrl> icon("icon");
+ LLDefaultWidgetRegistry::Register<LLLineEditor> line_editor("line_editor");
+ LLDefaultWidgetRegistry::Register<LLSearchEditor> search_editor("search_editor");
+ LLDefaultWidgetRegistry::Register<LLMenuItemSeparatorGL> menu_item_separator("menu_item_separator");
+ LLDefaultWidgetRegistry::Register<LLMenuItemCallGL> menu_item_call_gl("menu_item_call");
+ LLDefaultWidgetRegistry::Register<LLMenuItemCheckGL> menu_item_check_gl("menu_item_check");
+ LLDefaultWidgetRegistry::Register<LLMenuGL> menu("menu");
+ LLDefaultWidgetRegistry::Register<LLMenuBarGL> menu_bar("menu_bar");
+ LLDefaultWidgetRegistry::Register<LLContextMenu> context_menu("context_menu");
+ LLDefaultWidgetRegistry::Register<LLMultiSlider> multi_slider_bar("multi_slider_bar");
+ LLDefaultWidgetRegistry::Register<LLMultiSliderCtrl> multi_slider("multi_slider");
+ LLDefaultWidgetRegistry::Register<LLPanel> panel("panel", &LLPanel::fromXML);
+ LLDefaultWidgetRegistry::Register<LLLayoutStack> layout_stack("layout_stack", &LLLayoutStack::fromXML);
+ LLDefaultWidgetRegistry::Register<LLProgressBar> progress_bar("progress_bar");
+ LLDefaultWidgetRegistry::Register<LLRadioGroup> radio_group("radio_group");
+ LLDefaultWidgetRegistry::Register<LLRadioCtrl> radio_item("radio_item");
+ LLDefaultWidgetRegistry::Register<LLScrollContainer> scroll_container("scroll_container");
+ LLDefaultWidgetRegistry::Register<LLScrollingPanelList> scrolling_panel_list("scrolling_panel_list");
+ LLDefaultWidgetRegistry::Register<LLScrollListCtrl> scroll_list("scroll_list");
+ LLDefaultWidgetRegistry::Register<LLSlider> slider_bar("slider_bar");
+ LLDefaultWidgetRegistry::Register<LLSliderCtrl> slider("slider");
+ LLDefaultWidgetRegistry::Register<LLSpinCtrl> spinner("spinner");
+ LLDefaultWidgetRegistry::Register<LLStatBar> stat_bar("stat_bar");
+ //LLDefaultWidgetRegistry::Register<LLPlaceHolderPanel> placeholder("placeholder");
+ LLDefaultWidgetRegistry::Register<LLTabContainer> tab_container("tab_container");
+ LLDefaultWidgetRegistry::Register<LLTextBox> text("text");
+ LLDefaultWidgetRegistry::Register<LLTextEditor> simple_text_editor("simple_text_editor");
+ LLDefaultWidgetRegistry::Register<LLUICtrl> ui_ctrl("ui_ctrl");
+ LLDefaultWidgetRegistry::Register<LLStatView> stat_view("stat_view");
+ //LLDefaultWidgetRegistry::Register<LLUICtrlLocate> locate("locate");
+ //LLDefaultWidgetRegistry::Register<LLUICtrlLocate> pad("pad");
+ LLDefaultWidgetRegistry::Register<LLViewBorder> view_border("view_border");
}
// *HACK: Usually this is registered as a viewer text editor
- LLRegisterWidget<LLTextEditor> text_editor("text_editor");
+ LLDefaultWidgetRegistry::Register<LLTextEditor> text_editor("text_editor");
}
diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.h b/indra/integration_tests/llui_libtest/llwidgetreg.h
index 263e3958c9..eac818608d 100644
--- a/indra/integration_tests/llui_libtest/llwidgetreg.h
+++ b/indra/integration_tests/llui_libtest/llwidgetreg.h
@@ -33,7 +33,7 @@
// Register all widgets with the builder registry.
// Useful on Windows where linker discards all references to the
-// static LLRegisterWidget<> calls.
+// static LLDefaultWidgetRegistry::Register<> calls.
class LLWidgetReg
{
public: