summaryrefslogtreecommitdiff
path: root/indra/newview/tests/lltextureinfo_test.cpp
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2025-12-11 17:41:55 -0500
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-12-15 19:02:17 +0200
commita1eee717de59c0b1f514cedb7a7614d4b0a62e65 (patch)
treefa456591d01bcb0ff98a6ee2ab193af734265d44 /indra/newview/tests/lltextureinfo_test.cpp
parent3b88739957d8b0d5072646e571d27b743e68fe2e (diff)
Restore multiple disabled tests in llcharacter and newview
Clean up dead test files from llcommon and newview Signed-off-by: Rye <rye@alchemyviewer.org>
Diffstat (limited to 'indra/newview/tests/lltextureinfo_test.cpp')
-rw-r--r--indra/newview/tests/lltextureinfo_test.cpp81
1 files changed, 62 insertions, 19 deletions
diff --git a/indra/newview/tests/lltextureinfo_test.cpp b/indra/newview/tests/lltextureinfo_test.cpp
index d491ce0f65..58451a1069 100644
--- a/indra/newview/tests/lltextureinfo_test.cpp
+++ b/indra/newview/tests/lltextureinfo_test.cpp
@@ -32,6 +32,13 @@
// Dependencies
#include "../lltextureinfodetails.cpp"
+#include "../llagent.h"
+#include "../llappviewer.h"
+#include "../llmeshrepository.h"
+#include "../lltexturecache.h"
+#include "../lltexturefetch.h"
+#include "../llvocache.h"
+
// Tut header
#include "../test/lltut.h"
@@ -43,6 +50,39 @@
// * Do not make any assumption as to how those classes or methods work (i.e. don't copy/paste code)
// * A simulator for a class can be implemented here. Please comment and document thoroughly.
+LLControlGroup gSavedSettings("Global");
+
+void send_texture_stats_to_sim(const LLSD& texture_stats) {}
+
+LLAgent gAgent;
+LLAgent::LLAgent() : mAgentAccess(nullptr) { }
+LLAgent::~LLAgent() { }
+LLViewerRegion* LLAgent::getRegion() const { return nullptr; }
+
+LLTextureCache* LLAppViewer::sTextureCache = nullptr;
+LLTextureFetch* LLAppViewer::sTextureFetch = nullptr;
+
+U32 LLMeshRepository::sCacheReads = 0;
+std::atomic<U32> LLMeshRepository::sCacheWrites = 0;
+
+S64 LLTextureCache::sCacheMaxTexturesSize = 0; // no limit
+
+void LLTextureFetch::getStateStats(U32* cache_read, U32* cache_write, U32* res_wait)
+{
+ *cache_read = 0;
+ *cache_write = 0;
+ *res_wait = 0;
+}
+
+LLVOCache::LLVOCache(bool read_only) :
+ mInitialized(false),
+ mReadOnly(read_only),
+ mNumEntries(0),
+ mCacheSize(1),
+ mEnabled(true)
+{}
+
+LLVOCache::~LLVOCache() {}
// End Stubbing
// -------------------------------------------------------------------------------------------
@@ -89,7 +129,7 @@ namespace tut
void textureinfo_object_t::test<1>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
ensure("have we crashed?", true);
}
@@ -98,7 +138,7 @@ namespace tut
void textureinfo_object_t::test<2>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
LLUUID nonExistant("3a0efa3b-84dc-4e17-9b8c-79ea028850c1");
ensure(!tex_info.has(nonExistant));
@@ -109,7 +149,7 @@ namespace tut
void textureinfo_object_t::test<3>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
LLUUID id("10e65d70-46fd-429f-841a-bf698e9424d3");
tex_info.setRequestStartTime(id, 200);
@@ -122,7 +162,7 @@ namespace tut
void textureinfo_object_t::test<4>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
LLUUID nonExistant("3a0efa3b-84dc-4e17-9b8c-79ea028850c1");
ensure_equals(tex_info.getRequestStartTime(nonExistant), 0);
@@ -133,7 +173,7 @@ namespace tut
void textureinfo_object_t::test<5>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
LLUUID nonExistant("3a0efa3b-84dc-4e17-9b8c-79ea028850c1");
ensure_equals(tex_info.getRequestCompleteTime(nonExistant), 0);
@@ -144,7 +184,7 @@ namespace tut
void textureinfo_object_t::test<6>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
LLUUID id("10e65d70-46fd-429f-841a-bf698e9424d3");
tex_info.setRequestSize(id, 600);
@@ -157,7 +197,7 @@ namespace tut
void textureinfo_object_t::test<7>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
LLUUID id("10e65d70-46fd-429f-841a-bf698e9424d3");
tex_info.setRequestType(id, LLTextureInfoDetails::REQUEST_TYPE_HTTP);
@@ -170,7 +210,7 @@ namespace tut
void textureinfo_object_t::test<8>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
LLUUID id("10e65d70-46fd-429f-841a-bf698e9424d3");
tex_info.setRequestType(id, LLTextureInfoDetails::REQUEST_TYPE_UDP);
@@ -183,7 +223,7 @@ namespace tut
void textureinfo_object_t::test<9>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
LLUUID id("10e65d70-46fd-429f-841a-bf698e9424d3");
tex_info.setRequestOffset(id, 1234);
@@ -195,11 +235,13 @@ namespace tut
template<> template<>
void textureinfo_object_t::test<10>()
{
+ skip("Test skipped due to use of LLTrace stats failing in test");
+
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
S32 requestStartTimeOne = 200;
- S32 requestEndTimeOne = 400;
+ U64Microseconds requestEndTimeOne(400);
S32 requestSizeOne = 1024;
S32 requestSizeOneBits = requestSizeOne * 8;
LLUUID id1("10e65d70-46fd-429f-841a-bf698e9424d3");
@@ -209,7 +251,7 @@ namespace tut
tex_info.setRequestCompleteTimeAndLog(id1, requestEndTimeOne);
U32 requestStartTimeTwo = 100;
- U32 requestEndTimeTwo = 500;
+ U64Microseconds requestEndTimeTwo(500);
U32 requestSizeTwo = 2048;
S32 requestSizeTwoBits = requestSizeTwo * 8;
LLUUID id2("10e65d70-46fd-429f-841a-bf698e9424d4");
@@ -218,8 +260,9 @@ namespace tut
tex_info.setRequestType(id2, LLTextureInfoDetails::REQUEST_TYPE_HTTP);
tex_info.setRequestCompleteTimeAndLog(id2, requestEndTimeTwo);
- S32 averageBitRate = ((requestSizeOneBits/(requestEndTimeOne - requestStartTimeOne)) +
- (requestSizeTwoBits/(requestEndTimeTwo - requestStartTimeTwo))) / 2;
+ S32 averageBitRate = ((requestSizeOneBits / (S32(requestEndTimeOne.value()) - requestStartTimeOne)) +
+ (requestSizeTwoBits / (S32(requestEndTimeTwo.value()) - requestStartTimeTwo))) /
+ 2;
S32 totalBytes = requestSizeOne + requestSizeTwo;
@@ -234,10 +277,10 @@ namespace tut
void textureinfo_object_t::test<11>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
S32 requestStartTimeOne = 200;
- S32 requestEndTimeOne = 400;
+ U64Microseconds requestEndTimeOne(400);
S32 requestSizeOne = 1024;
LLUUID id1("10e65d70-46fd-429f-841a-bf698e9424d3");
tex_info.setRequestStartTime(id1, requestStartTimeOne);
@@ -246,7 +289,7 @@ namespace tut
tex_info.setRequestCompleteTimeAndLog(id1, requestEndTimeOne);
tex_info.getAverages();
- tex_info.reset();
+ tex_info.resetTextureStatistics();
LLSD results = tex_info.getAverages();
ensure_equals("is average bits per second correct", results["bits_per_second"].asInteger(), 0);
ensure_equals("is total bytes is correct", results["bytes_downloaded"].asInteger(), 0);
@@ -258,10 +301,10 @@ namespace tut
void textureinfo_object_t::test<12>()
{
LLTextureInfo tex_info;
- tex_info.setUpLogging(true, true);
+ tex_info.setLogging(true);
S32 requestStartTimeOne = 200;
- S32 requestEndTimeOne = 400;
+ U64Microseconds requestEndTimeOne(400);
S32 requestSizeOne = 1024;
LLUUID id1("10e65d70-46fd-429f-841a-bf698e9424d3");
tex_info.setRequestStartTime(id1, requestStartTimeOne);