summaryrefslogtreecommitdiff
path: root/indra/integration_tests
diff options
context:
space:
mode:
Diffstat (limited to 'indra/integration_tests')
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/CMakeLists.txt0
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/llimage_libtest/CMakeLists.txt3
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/llimage_libtest/llimage_libtest.cpp70
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/llimage_libtest/llimage_libtest.h0
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/llui_libtest/CMakeLists.txt12
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/llui_libtest/llui_libtest.cpp29
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/llui_libtest/llui_libtest.h0
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/llui_libtest/llwidgetreg.cpp0
-rwxr-xr-x[-rw-r--r--]indra/integration_tests/llui_libtest/llwidgetreg.h0
9 files changed, 87 insertions, 27 deletions
diff --git a/indra/integration_tests/CMakeLists.txt b/indra/integration_tests/CMakeLists.txt
index ced2b3dbcf..ced2b3dbcf 100644..100755
--- a/indra/integration_tests/CMakeLists.txt
+++ b/indra/integration_tests/CMakeLists.txt
diff --git a/indra/integration_tests/llimage_libtest/CMakeLists.txt b/indra/integration_tests/llimage_libtest/CMakeLists.txt
index af5c9fb2e7..36a7d38bb7 100644..100755
--- a/indra/integration_tests/llimage_libtest/CMakeLists.txt
+++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt
@@ -16,6 +16,9 @@ include_directories(
${LLVFS_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
)
+include_directories(SYSTEM
+ ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
+ )
set(llimage_libtest_SOURCE_FILES
llimage_libtest.cpp
diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
index 48e876429d..034c816742 100644..100755
--- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
+++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
@@ -54,6 +54,11 @@ static const char USAGE[] = "\n"
" -o, --output <file1 .. file2> OR <type>\n"
" List of image files to create (assumes same order as for input files)\n"
" OR 3 letters file type extension to convert each input file into.\n"
+" -load, --load_size <n>\n"
+" Portion of the input file to load, in bytes."
+" If (load == 0), it will load the whole file."
+" If (load == -1), it will load the size relevant to reach the requested discard level (see -d)."
+" Only valid for j2c images. Default is 0 (load whole file).\n"
" -r, --region <x0, y0, x1, y1>\n"
" Crop region applied to the input files in pixels.\n"
" Only used for j2c images. Default is no region cropping.\n"
@@ -104,22 +109,52 @@ void output_image_stats(LLPointer<LLImageFormatted> image, const std::string &fi
// Print out some statistical data on the image
std::cout << "Image stats for : " << filename << ", extension : " << image->getExtension() << std::endl;
- std::cout << " with : " << (int)(image->getWidth()) << ", height : " << (int)(image->getHeight()) << std::endl;
- std::cout << " comp : " << (int)(image->getComponents()) << ", levels : " << (int)(image->getDiscardLevel()) << std::endl;
- std::cout << " head : " << (int)(image->calcHeaderSize()) << ", data : " << (int)(image->getDataSize()) << std::endl;
+ std::cout << " with : " << (int)(image->getWidth()) << ", height : " << (int)(image->getHeight()) << std::endl;
+ std::cout << " comp : " << (int)(image->getComponents()) << ", levels : " << (int)(image->getLevels()) << std::endl;
+ std::cout << " head : " << (int)(image->calcHeaderSize()) << ", data : " << (int)(image->getDataSize()) << std::endl;
return;
}
// Load an image from file and return a raw (decompressed) instance of its data
-LLPointer<LLImageRaw> load_image(const std::string &src_filename, int discard_level, int* region, bool output_stats)
+LLPointer<LLImageRaw> load_image(const std::string &src_filename, int discard_level, int* region, int load_size, bool output_stats)
{
LLPointer<LLImageFormatted> image = create_image(src_filename);
- // This just loads the image file stream into a buffer. No decoding done.
- if (!image->load(src_filename))
+ // We support partial loading only for j2c images
+ if (image->getCodec() == IMG_CODEC_J2C)
{
- return NULL;
+ // Load the header
+ if (!image->load(src_filename, 600))
+ {
+ return NULL;
+ }
+ S32 h = ((LLImageJ2C*)(image.get()))->calcHeaderSize();
+ S32 d = (load_size > 0 ? ((LLImageJ2C*)(image.get()))->calcDiscardLevelBytes(load_size) : 0);
+ S8 r = ((LLImageJ2C*)(image.get()))->getRawDiscardLevel();
+ std::cout << "Merov debug : header = " << h << ", load_size = " << load_size << ", discard level = " << d << ", raw discard level = " << r << std::endl;
+ for (d = 0; d < MAX_DISCARD_LEVEL; d++)
+ {
+ S32 data_size = ((LLImageJ2C*)(image.get()))->calcDataSize(d);
+ std::cout << "Merov debug : discard_level = " << d << ", data_size = " << data_size << std::endl;
+ }
+ if (load_size < 0)
+ {
+ load_size = (discard_level != -1 ? ((LLImageJ2C*)(image.get()))->calcDataSize(discard_level) : 0);
+ }
+ // Load the requested byte range
+ if (!image->load(src_filename, load_size))
+ {
+ return NULL;
+ }
+ }
+ else
+ {
+ // This just loads the image file stream into a buffer. No decoding done.
+ if (!image->load(src_filename))
+ {
+ return NULL;
+ }
}
if( (image->getComponents() != 3) && (image->getComponents() != 4) )
@@ -205,7 +240,7 @@ void store_input_file(std::list<std::string> &input_filenames, const std::string
LLDirIterator iter(dir, name);
while (iter.next(next_name))
{
- std::string file_name = dir + gDirUtilp->getDirDelimiter() + next_name;
+ std::string file_name = gDirUtilp->add(dir, next_name);
input_filenames.push_back(file_name);
}
}
@@ -310,6 +345,7 @@ int main(int argc, char** argv)
bool image_stats = false;
int* region = NULL;
int discard_level = -1;
+ int load_size = 0;
int precincts_size = -1;
int blocks_size = -1;
int levels = 0;
@@ -396,6 +432,22 @@ int main(int argc, char** argv)
discard_level = llclamp(discard_level,0,5);
}
}
+ else if (!strcmp(argv[arg], "--load_size") || !strcmp(argv[arg], "-load"))
+ {
+ std::string value_str;
+ if ((arg + 1) < argc)
+ {
+ value_str = argv[arg+1];
+ }
+ if (((arg + 1) >= argc) || (value_str[0] == '-'))
+ {
+ std::cout << "No valid --load_size argument given, load_size ignored" << std::endl;
+ }
+ else
+ {
+ load_size = atoi(value_str.c_str());
+ }
+ }
else if (!strcmp(argv[arg], "--precincts") || !strcmp(argv[arg], "-p"))
{
std::string value_str;
@@ -510,7 +562,7 @@ int main(int argc, char** argv)
for (; in_file != in_end; ++in_file, ++out_file)
{
// Load file
- LLPointer<LLImageRaw> raw_image = load_image(*in_file, discard_level, region, image_stats);
+ LLPointer<LLImageRaw> raw_image = load_image(*in_file, discard_level, region, load_size, image_stats);
if (!raw_image)
{
std::cout << "Error: Image " << *in_file << " could not be loaded" << std::endl;
diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.h b/indra/integration_tests/llimage_libtest/llimage_libtest.h
index 63f3d46b50..63f3d46b50 100644..100755
--- a/indra/integration_tests/llimage_libtest/llimage_libtest.h
+++ b/indra/integration_tests/llimage_libtest/llimage_libtest.h
diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt
index 1180460f4b..34e34c7e47 100644..100755
--- a/indra/integration_tests/llui_libtest/CMakeLists.txt
+++ b/indra/integration_tests/llui_libtest/CMakeLists.txt
@@ -18,7 +18,7 @@ include(LLWindow)
include(LLUI)
include(LLVFS) # ugh, needed for LLDir
include(LLXML)
-include(LLXUIXML)
+include(Hunspell)
include(Linking)
# include(Tut)
@@ -32,7 +32,11 @@ include_directories(
${LLVFS_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
- ${LLXUIXML_INCLUDE_DIRS}
+ ${LIBS_PREBUILD_DIR}/include/hunspell
+ )
+include_directories(SYSTEM
+ ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
+ ${LLXML_SYSTEM_INCLUDE_DIRS}
)
set(llui_libtest_SOURCE_FILES
@@ -56,7 +60,8 @@ add_executable(llui_libtest ${llui_libtest_SOURCE_FILES})
# Link with OS-specific libraries for LLWindow dependency
if (DARWIN)
find_library(COCOA_LIBRARY Cocoa)
- set(OS_LIBRARIES ${COCOA_LIBRARY})
+ find_library(IOKIT_LIBRARY IOKit)
+ set(OS_LIBRARIES ${COCOA_LIBRARY} ${IOKIT_LIBRARY})
elseif (WINDOWS)
#ll_stack_trace needs this now...
list(APPEND WINDOWS_LIBRARIES dbghelp)
@@ -80,6 +85,7 @@ target_link_libraries(llui_libtest
${LLIMAGEJ2COJ_LIBRARIES}
${OS_LIBRARIES}
${GOOGLE_PERFTOOLS_LIBRARIES}
+ ${HUNSPELL_LIBRARY}
)
if (WINDOWS)
diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp
index 217e26c3ca..38aa1bbeb2 100644..100755
--- a/indra/integration_tests/llui_libtest/llui_libtest.cpp
+++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp
@@ -107,12 +107,6 @@ public:
};
TestImageProvider gTestImageProvider;
-static std::string get_xui_dir()
-{
- std::string delim = gDirUtilp->getDirDelimiter();
- return gDirUtilp->getSkinBaseDir() + delim + "default" + delim + "xui" + delim;
-}
-
void init_llui()
{
// Font lookup needs directory support
@@ -122,13 +116,12 @@ void init_llui()
const char* newview_path = "../../../newview";
#endif
gDirUtilp->initAppDirs("SecondLife", newview_path);
- gDirUtilp->setSkinFolder("default");
+ gDirUtilp->setSkinFolder("default", "en");
// colors are no longer stored in a LLControlGroup file
LLUIColorTable::instance().loadFromSettings();
- std::string config_filename = gDirUtilp->getExpandedFilename(
- LL_PATH_APP_SETTINGS, "settings.xml");
+ std::string config_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings.xml");
gSavedSettings.loadFromFile(config_filename);
// See LLAppViewer::init()
@@ -143,9 +136,7 @@ void init_llui()
const bool no_register_widgets = false;
LLWidgetReg::initClass( no_register_widgets );
-
- // Unclear if this is needed
- LLUI::setupPaths();
+
// Otherwise we get translation warnings when setting up floaters
// (tooltips for buttons)
std::set<std::string> default_args;
@@ -157,7 +148,6 @@ void init_llui()
// otherwise it crashes.
LLFontGL::initClass(96.f, 1.f, 1.f,
gDirUtilp->getAppRODataDir(),
- LLUI::getXUIPaths(),
false ); // don't create gl textures
LLFloaterView::Params fvparams;
@@ -169,6 +159,14 @@ void init_llui()
gFloaterView = LLUICtrlFactory::create<LLFloaterView> (fvparams);
}
+/*==========================================================================*|
+static std::string get_xui_dir()
+{
+ std::string delim = gDirUtilp->getDirDelimiter();
+ return gDirUtilp->getSkinBaseDir() + delim + "default" + delim + "xui" + delim;
+}
+
+// buildFromFile() no longer supports generate-output-LLXMLNode
void export_test_floaters()
{
// Convert all test floaters to new XML format
@@ -191,7 +189,7 @@ void export_test_floaters()
floater->buildFromFile( filename,
// FALSE, // don't open floater
output_node);
- std::string out_filename = xui_dir + filename;
+ std::string out_filename = gDirUtilp->add(xui_dir, filename);
std::string::size_type extension_pos = out_filename.rfind(".xml");
out_filename.resize(extension_pos);
out_filename += "_new.xml";
@@ -203,6 +201,7 @@ void export_test_floaters()
fclose(floater_file);
}
}
+|*==========================================================================*/
int main(int argc, char** argv)
{
@@ -211,7 +210,7 @@ int main(int argc, char** argv)
init_llui();
- export_test_floaters();
+// export_test_floaters();
return 0;
}
diff --git a/indra/integration_tests/llui_libtest/llui_libtest.h b/indra/integration_tests/llui_libtest/llui_libtest.h
index d365ebb5e0..d365ebb5e0 100644..100755
--- a/indra/integration_tests/llui_libtest/llui_libtest.h
+++ b/indra/integration_tests/llui_libtest/llui_libtest.h
diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.cpp b/indra/integration_tests/llui_libtest/llwidgetreg.cpp
index cbf6021119..cbf6021119 100644..100755
--- a/indra/integration_tests/llui_libtest/llwidgetreg.cpp
+++ b/indra/integration_tests/llui_libtest/llwidgetreg.cpp
diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.h b/indra/integration_tests/llui_libtest/llwidgetreg.h
index 30b915eee2..30b915eee2 100644..100755
--- a/indra/integration_tests/llui_libtest/llwidgetreg.h
+++ b/indra/integration_tests/llui_libtest/llwidgetreg.h