From 406927f6293efa416b174cfa1c88689aab9615f7 Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Wed, 14 Oct 2009 10:40:56 +0000 Subject: Merge a big bunch of fixes from maint-viewer. Hooray. svn merge -r136066:136073 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-viewer/maint-viewer-24-qa-9 DEV-8553 New Server Tools - Prep Land For Sale DEV-32942 (QAR-1521) Bad border crossings or TP / Ruthing issues DEV-32942 (QAR-1521) Bad border crossings or TP / Ruthing issues DEV-33239 VWR-13816: Resizing the Search Window Causes the Results to Refresh back to First Page DEV-27746 Running a dev build of Second Life will make console window show up on non-dev builds (Windows) DEV-33209 Linux 1.24.0.120778 client fails to run DEV-29123 SVC-3871: Crash of viewer when clicking on ghost objects at (0,0,0) on a sim DEV-35433 Attempting to upload wrong file type crashes viewer DEV-33499 viewer2009 is not using KDU DEV-33912 Griefing viewer crashes others' viewers with malformed sound files DEV-3784 VWR-138: Animation Priority not working correctly, Can't create new AOs DEV-20678 VWR-9069: Region variable says 'Region Name' in AR if no object is selected DEV-19934 Help->About Second Life doesn't differentiate between 32- and 64-bit Vista DEV-6604 Restored folders have 'Purge Item' and 'Restore Item' options DEV-12867 VWR-5717: Selected Text is not replaced by Input text when Japanese IME is on DEV-11894 Notecards/Texture windows don't open completely when opened from inventory DEV-10641 VWR-4955: Local Chat doesn't show end of last conversation DEV-30039 VWR-12620: Viewer build fails on Linux when compiled with -O2 (--type=Release) DEV-20944 VWR-9065: (intermittent) Right Click >profile on avatar does not display profile DEV-24828 Menu accelerator prefixes shouldn't be hard-coded DEV-34529 VWR-14267: Clicking send in an IM window does not add the sent text to the line editor history DEV-34124 Invite to group, search by name will not show resident if their first name is two characters DEV-20930 VWR-9248: On Mac: the "--url" option causes a command line parsing error DEV-35306 Adult keyword filter triggers multiple warnings DEV-35503 VWR-3595: "Second Life requires True Color (32-bit) to run in a window" message is incorrect DEV-35656 VWR-12995: FTBFS: error: format '%-3d' expects type 'int', but argument 3 has type 'size_t' DEV-30043 VWR-12533: Linux viewer build for OpenAL fails during packaging unless FMOD library is available DEV-31898 VWR-13202: Right clicking mouse triggers arrow key control events DEV-32610 Keyboard shortcuts on OSX viewer overridden by OSX DEV-27067 Coverity Prevent: EVALUATION_ORDER defects DEV-26188 VWR-2242: Specially formatted .BVH file can cause avatar distortion DEV-25475 About Land dialog no longer shows Area: field DEV-19897 OSX Viewer Installer (for an RC) opens with poor positioning DEV-22837 Inventory> Search Recent Items highlighting incorrect characters DEV-21709 VWR-9377: Mapping will default to leave exact sim name listing first. (Searching Gar forces Gar to come up and not Garden of Dreams) DEV-23079 implement volume serial for linux client DEV-13930 VWR-6432: Space Navigator operation with vehicles is broken DEV-27666 VWR-10829: Linux Viewer: CLICK_ACTION_PAY shows CLICK_ACTION_PLAY icon DEV-23670 Viewer crashes on startup if installed into a custom folder with Korean, Japanese or Chinese characters in path DEV-19313 VWR-8454: PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS not highlighted in script editor DEV-19918 VWR-8885: Move character/*.xml files to source bundle DEV-25555 VWR-11172: A source coding mistake prevents number-pad keys from specifying Ctrl+digit shortcuts on Windows DEV-8536 VWR-4057: Multi-line chat display bug - first character in line missing DEV-29592 Mac LLFastTimer uses wall clock instead of Intel PMU DEV-29644 VWR-12587: Cmake install target has a hard coded secondlife-bin reference remaining DEV-25320 VWR-11128: Python not always detected by develop.py DEV-30040 VWR-12617: Poor type name that violates Coding Standard breaks compatibility with system header files DEV-30380 indra/newview/res-sdl/toolpay.BMP is modified during ./develop.py configure DEV-31247 VWR-12763: non-portable printf specifier used with size_t causes FTBFS on 64bit (due to -Werror) DEV-29565 VWR-12569: A comment in lluistring.h contains undefined UTF-8 code sequences DEV-22100 VWR-9620: send_parcel_select_objects in newview/llfloaterland.cpp uses the wrong datatype for the ReturnType field causing a warning DEV-31911 Selected objects / primitives should be greyed out when nothing is selected DEV-3667 Windows: Accelerator keys should be "Ctrl+X" rather than "Ctrl-X" DEV-27223 disable gstreamer on 64-bit linux DEV-8172 We Need a Linden Sale Option to Sell Land to Anyone DEV-25511 VWR-10311: Enable LipSync by default DEV-20443 Revamp group creation confirmation dialog to be more communicative DEV-20132 VWR-7800: Joystick / SpaceNavigator. Camera should remain in position when exiting flycam mode into avatar mode. DEV-18420 VWR-8393: Have build scripts copy fmod from an external location DEV-24841 VWR-10717: Right Space Navigator button should toggle fly in avatar movment, not jump/flyup. DEV-28457 change auto-populate value in buy L$ window from 1000 to 2000 DEV-15545 VWR-3725: Please add resize option to the SEARCH window UI --- indra/llcharacter/llbvhloader.cpp | 13 +++++++++++++ indra/llcharacter/llbvhloader.h | 7 +++++-- indra/llcharacter/llgesture.cpp | 2 +- indra/llcharacter/lljointsolverrp3.cpp | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) (limited to 'indra/llcharacter') diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 24391eb8f3..3dd54b4760 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -91,7 +91,9 @@ const char *LLBVHLoader::ST_NO_XLT_EASEIN = "Can't get easeIn values."; const char *LLBVHLoader::ST_NO_XLT_EASEOUT = "Can't get easeOut values."; const char *LLBVHLoader::ST_NO_XLT_HAND = "Can't get hand morph value."; const char *LLBVHLoader::ST_NO_XLT_EMOTE = "Can't read emote name."; +const char *LLBVHLoader::ST_BAD_ROOT = "Illegal ROOT joint."; */ + //------------------------------------------------------------------------ // find_next_whitespace() //------------------------------------------------------------------------ @@ -777,6 +779,17 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & return E_ST_NO_NAME; } + //--------------------------------------------------------------- + // we require the root joint be "hip" - DEV-26188 + //--------------------------------------------------------------- + const char* FORCED_ROOT_NAME = "hip"; + if ( (mJoints.size() == 0 ) && ( !strstr(jointName, FORCED_ROOT_NAME) ) ) + { + strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */ + return E_ST_BAD_ROOT; + } + + //---------------------------------------------------------------- // add a set of keyframes for this joint //---------------------------------------------------------------- diff --git a/indra/llcharacter/llbvhloader.h b/indra/llcharacter/llbvhloader.h index ecdfc95478..85ab035e61 100644 --- a/indra/llcharacter/llbvhloader.h +++ b/indra/llcharacter/llbvhloader.h @@ -216,7 +216,8 @@ typedef enum e_load_status E_ST_NO_XLT_EASEIN, E_ST_NO_XLT_EASEOUT, E_ST_NO_XLT_HAND, - E_ST_NO_XLT_EMOTE + E_ST_NO_XLT_EMOTE, + E_ST_BAD_ROOT } ELoadStatus; //------------------------------------------------------------------------ @@ -235,7 +236,7 @@ public: /* // Status Codes - typedef const char *Status; + typedef const char *status_t; static const char *ST_OK; static const char *ST_EOF; static const char *ST_NO_CONSTRAINT; @@ -267,6 +268,7 @@ public: static const char *ST_NO_XLT_EASEOUT; static const char *ST_NO_XLT_HAND; static const char *ST_NO_XLT_EMOTE; + static const char *ST_BAD_ROOT; */ // Loads the specified translation table. ELoadStatus loadTranslationTable(const char *fileName); @@ -325,6 +327,7 @@ protected: BOOL mInitialized; ELoadStatus mStatus; + // computed values F32 mDuration; }; diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index 4ee29fe100..83e4e35b00 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -304,7 +304,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask) } else { - llwarns << "NULL gesture in gesture list (" << i << ")" << llendl + llwarns << "NULL gesture in gesture list (" << i << ")" << llendl; } } return FALSE; diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp index 0ea92a2d77..6599a76b16 100644 --- a/indra/llcharacter/lljointsolverrp3.cpp +++ b/indra/llcharacter/lljointsolverrp3.cpp @@ -211,7 +211,7 @@ void LLJointSolverRP3::solve() //------------------------------------------------------------------------- LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec)); -// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl +// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl; //------------------------------------------------------------------------- // compute the normal of the original ABC plane (and store for later) -- cgit v1.3 From 226c08130d6648bc53b25f45d2ec2a5d7b9f8977 Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Thu, 15 Oct 2009 16:43:12 +0000 Subject: DEV-41343 lljoint unit test - resurrected - this was previously disabled (and old-style monolithic tut) --- indra/llcharacter/CMakeLists.txt | 10 ++ indra/llcharacter/tests/lljoint_test.cpp | 246 +++++++++++++++++++++++++++++++ indra/test/CMakeLists.txt | 1 - 3 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 indra/llcharacter/tests/lljoint_test.cpp (limited to 'indra/llcharacter') diff --git a/indra/llcharacter/CMakeLists.txt b/indra/llcharacter/CMakeLists.txt index 612229d16b..85e3f97092 100644 --- a/indra/llcharacter/CMakeLists.txt +++ b/indra/llcharacter/CMakeLists.txt @@ -75,3 +75,13 @@ set_source_files_properties(${llcharacter_HEADER_FILES} list(APPEND llcharacter_SOURCE_FILES ${llcharacter_HEADER_FILES}) add_library (llcharacter ${llcharacter_SOURCE_FILES}) + + +# Add tests +include(LLAddBuildTest) +# UNIT TESTS +SET(llcharacter_TEST_SOURCE_FILES + lljoint.cpp + ) +LL_ADD_PROJECT_UNIT_TESTS(llcharacter "${llcharacter_TEST_SOURCE_FILES}") + diff --git a/indra/llcharacter/tests/lljoint_test.cpp b/indra/llcharacter/tests/lljoint_test.cpp new file mode 100644 index 0000000000..e43e164dd1 --- /dev/null +++ b/indra/llcharacter/tests/lljoint_test.cpp @@ -0,0 +1,246 @@ +/** + * @file lljoint_tut.cpp + * @author Adroit + * @date 2007-03 + * @brief lljoint test cases. + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" +#include "m4math.h" +#include "v3math.h" + +#include "../lljoint.h" + +#include "../test/lltut.h" + + +namespace tut +{ + struct lljoint_data + { + }; + typedef test_group lljoint_test; + typedef lljoint_test::object lljoint_object; + tut::lljoint_test lljoint_testcase("lljoint"); + + template<> template<> + void lljoint_object::test<1>() + { + LLJoint lljoint; + LLJoint* jnt = lljoint.getParent(); + ensure("getParent() failed ", (NULL == jnt)); + ensure("getRoot() failed ", (&lljoint == lljoint.getRoot())); + } + + template<> template<> + void lljoint_object::test<2>() + { + std::string str = "LLJoint"; + LLJoint parent(str), child; + child.setup(str, &parent); + LLJoint* jnt = child.getParent(); + ensure("setup() failed ", (&parent == jnt)); + } + + template<> template<> + void lljoint_object::test<3>() + { + LLJoint parent, child; + std::string str = "LLJoint"; + child.setup(str, &parent); + LLJoint* jnt = parent.findJoint(str); + ensure("findJoint() failed ", (&child == jnt)); + } + + template<> template<> + void lljoint_object::test<4>() + { + LLJoint parent; + std::string str1 = "LLJoint", str2; + parent.setName(str1); + str2 = parent.getName(); + ensure("setName() failed ", (str1 == str2)); + } + + template<> template<> + void lljoint_object::test<5>() + { + LLJoint lljoint; + LLVector3 vec3(2.3f,30.f,10.f); + lljoint.setPosition(vec3); + LLVector3 pos = lljoint.getPosition(); + ensure("setPosition()/getPosition() failed ", (vec3 == pos)); + } + + template<> template<> + void lljoint_object::test<6>() + { + LLJoint lljoint; + LLVector3 vec3(2.3f,30.f,10.f); + lljoint.setWorldPosition(vec3); + LLVector3 pos = lljoint.getWorldPosition(); + ensure("1:setWorldPosition()/getWorldPosition() failed ", (vec3 == pos)); + LLVector3 lastPos = lljoint.getLastWorldPosition(); + ensure("2:getLastWorldPosition failed ", (vec3 == lastPos)); + } + + template<> template<> + void lljoint_object::test<7>() + { + LLJoint lljoint("LLJoint"); + LLQuaternion q(2.3f,30.f,10.f,1.f); + lljoint.setRotation(q); + LLQuaternion rot = lljoint.getRotation(); + ensure("setRotation()/getRotation() failed ", (q == rot)); + } + template<> template<> + void lljoint_object::test<8>() + { + LLJoint lljoint("LLJoint"); + LLQuaternion q(2.3f,30.f,10.f,1.f); + lljoint.setWorldRotation(q); + LLQuaternion rot = lljoint.getWorldRotation(); + ensure("1:setWorldRotation()/getWorldRotation() failed ", (q == rot)); + LLQuaternion lastRot = lljoint.getLastWorldRotation(); + ensure("2:getLastWorldRotation failed ", (q == lastRot)); + } + + template<> template<> + void lljoint_object::test<9>() + { + LLJoint lljoint; + LLVector3 vec3(2.3f,30.f,10.f); + lljoint.setScale(vec3); + LLVector3 scale = lljoint.getScale(); + ensure("setScale()/getScale failed ", (vec3 == scale)); + } + + template<> template<> + void lljoint_object::test<10>() + { + LLJoint lljoint("LLJoint"); + LLMatrix4 mat; + mat.setIdentity(); + lljoint.setWorldMatrix(mat);//giving warning setWorldMatrix not correctly implemented; + LLMatrix4 mat4 = lljoint.getWorldMatrix(); + ensure("setWorldMatrix()/getWorldMatrix failed ", (mat4 == mat)); + } + + template<> template<> + void lljoint_object::test<11>() + { + LLJoint lljoint("parent"); + S32 joint_num = 12; + lljoint.setJointNum(joint_num); + S32 jointNum = lljoint.getJointNum(); + ensure("setJointNum()/getJointNum failed ", (jointNum == joint_num)); + } + + template<> template<> + void lljoint_object::test<12>() + { + LLJoint lljoint; + LLVector3 vec3(2.3f,30.f,10.f); + lljoint.setSkinOffset(vec3); + LLVector3 offset = lljoint.getSkinOffset(); + ensure("1:setSkinOffset()/getSkinOffset() failed ", (vec3 == offset)); + } + + template<> template<> + void lljoint_object::test<13>() + { + LLJoint lljointgp("gparent"); + LLJoint lljoint("parent"); + LLJoint lljoint1("child1"); + lljoint.addChild(&lljoint1); + LLJoint lljoint2("child2"); + lljoint.addChild(&lljoint2); + LLJoint lljoint3("child3"); + lljoint.addChild(&lljoint3); + + LLJoint* jnt = NULL; + jnt = lljoint2.getParent(); + ensure("addChild() failed ", (&lljoint == jnt)); + LLJoint* jnt1 = lljoint.findJoint("child3"); + ensure("findJoint() failed ", (&lljoint3 == jnt1)); + lljoint.removeChild(&lljoint3); + LLJoint* jnt2 = lljoint.findJoint("child3"); + ensure("removeChild() failed ", (NULL == jnt2)); + + lljointgp.addChild(&lljoint); + ensure("GetParent() failed ", (&lljoint== lljoint2.getParent())); + ensure("getRoot() failed ", (&lljointgp == lljoint2.getRoot())); + + ensure("getRoot() failed ", &lljoint1 == lljoint.findJoint("child1")); + + lljointgp.removeAllChildren(); + // parent removed from grandparent - so should not be able to locate child + ensure("removeAllChildren() failed ", (NULL == lljointgp.findJoint("child1"))); + // it should still exist in parent though + ensure("removeAllChildren() failed ", (&lljoint1 == lljoint.findJoint("child1"))); + } + + template<> template<> + void lljoint_object::test<14>() + { + LLJoint lljointgp("gparent"); + + LLJoint llparent1("parent1"); + LLJoint llparent2("parent2"); + + LLJoint llchild("child1"); + LLJoint lladoptedchild("child2"); + llparent1.addChild(&llchild); + llparent1.addChild(&lladoptedchild); + + llparent2.addChild(&lladoptedchild); + ensure("1. addChild failed to remove prior parent", lladoptedchild.getParent() == &llparent2); + ensure("2. addChild failed to remove prior parent", llparent1.findJoint("child2") == NULL); + } + + + /* + Test cases for the following not added. They perform operations + on underlying LLXformMatrix and LLVector3 elements which have + been unit tested separately. + Unit Testing these functions will basically require re-implementing + logic of these function in the test case itself + + 1) void WorldMatrixChildren(); + 2) void updateWorldMatrixParent(); + 3) void updateWorldPRSParent(); + 4) void updateWorldMatrix(); + 5) LLXformMatrix *getXform() { return &mXform; } + 6) void setConstraintSilhouette(LLDynamicArray& silhouette); + 7) void clampRotation(LLQuaternion old_rot, LLQuaternion new_rot); + + */ +} + diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 52b370873f..ff68b2d68a 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -42,7 +42,6 @@ set(test_SOURCE_FILES llhttpnode_tut.cpp llinventoryparcel_tut.cpp lliohttpserver_tut.cpp - lljoint_tut.cpp llmime_tut.cpp llmessageconfig_tut.cpp llmodularmath_tut.cpp -- cgit v1.3