Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
423f5b00
Commit
423f5b00
authored
15 years ago
by
Adam Moss
Browse files
Options
Downloads
Patches
Plain Diff
DEV-41341 tut lltiming test -> llframetimer integration test
parent
925f01f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llcommon/CMakeLists.txt
+2
-0
2 additions, 0 deletions
indra/llcommon/CMakeLists.txt
indra/llcommon/tests/llframetimer_test.cpp
+118
-0
118 additions, 0 deletions
indra/llcommon/tests/llframetimer_test.cpp
indra/test/CMakeLists.txt
+0
-1
0 additions, 1 deletion
indra/test/CMakeLists.txt
with
120 additions
and
1 deletion
indra/llcommon/CMakeLists.txt
+
2
−
0
View file @
423f5b00
...
...
@@ -247,8 +247,10 @@ LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}")
LL_ADD_INTEGRATION_TEST
(
llrand
""
"
${
test_libs
}
"
)
LL_ADD_INTEGRATION_TEST
(
llsdserialize
""
"
${
test_libs
}
"
)
LL_ADD_INTEGRATION_TEST
(
llstring
""
"
${
test_libs
}
"
)
LL_ADD_INTEGRATION_TEST
(
llframetimer
""
"
${
test_libs
}
"
)
# *TODO - reenable these once tcmalloc libs no longer break the build.
#ADD_BUILD_TEST(llallocator llcommon)
#ADD_BUILD_TEST(llallocator_heap_profile llcommon)
#ADD_BUILD_TEST(llmemtype llcommon)
This diff is collapsed.
Click to expand it.
indra/llcommon/tests/llframetimer_test.cpp
0 → 100644
+
118
−
0
View file @
423f5b00
/**
* @file lltiming_tut.cpp
* @date 2006-07-23
* @brief Tests the timers.
*
* $LicenseInfo:firstyear=2006&license=viewergpl$
*
* Copyright (c) 2006-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
"../llframetimer.h"
#include
"../llsd.h"
#include
"../test/lltut.h"
namespace
tut
{
struct
frametimer_test
{
frametimer_test
()
{
LLFrameTimer
::
updateFrameTime
();
}
};
typedef
test_group
<
frametimer_test
>
frametimer_group_t
;
typedef
frametimer_group_t
::
object
frametimer_object_t
;
tut
::
frametimer_group_t
frametimer_instance
(
"frametimer"
);
template
<
>
template
<
>
void
frametimer_object_t
::
test
<
1
>
()
{
F64
seconds_since_epoch
=
LLFrameTimer
::
getTotalSeconds
();
LLFrameTimer
timer
;
timer
.
setExpiryAt
(
seconds_since_epoch
);
F64
expires_at
=
timer
.
expiresAt
();
ensure_distance
(
"set expiry matches get expiry"
,
expires_at
,
seconds_since_epoch
,
0.001
);
}
template
<
>
template
<
>
void
frametimer_object_t
::
test
<
2
>
()
{
F64
seconds_since_epoch
=
LLFrameTimer
::
getTotalSeconds
();
seconds_since_epoch
+=
10.0
;
LLFrameTimer
timer
;
timer
.
setExpiryAt
(
seconds_since_epoch
);
F64
expires_at
=
timer
.
expiresAt
();
ensure_distance
(
"set expiry matches get expiry 1"
,
expires_at
,
seconds_since_epoch
,
0.001
);
seconds_since_epoch
+=
10.0
;
timer
.
setExpiryAt
(
seconds_since_epoch
);
expires_at
=
timer
.
expiresAt
();
ensure_distance
(
"set expiry matches get expiry 2"
,
expires_at
,
seconds_since_epoch
,
0.001
);
}
template
<
>
template
<
>
void
frametimer_object_t
::
test
<
3
>
()
{
F64
seconds_since_epoch
=
LLFrameTimer
::
getTotalSeconds
();
seconds_since_epoch
+=
2.0
;
LLFrameTimer
timer
;
timer
.
setExpiryAt
(
seconds_since_epoch
);
ensure
(
"timer not expired on create"
,
!
timer
.
hasExpired
());
int
ii
;
for
(
ii
=
0
;
ii
<
10
;
++
ii
)
{
ms_sleep
(
150
);
LLFrameTimer
::
updateFrameTime
();
}
ensure
(
"timer not expired after a bit"
,
!
timer
.
hasExpired
());
for
(
ii
=
0
;
ii
<
10
;
++
ii
)
{
ms_sleep
(
100
);
LLFrameTimer
::
updateFrameTime
();
}
ensure
(
"timer expired"
,
timer
.
hasExpired
());
}
/*
template<> template<>
void frametimer_object_t::test<4>()
{
}
*/
}
This diff is collapsed.
Click to expand it.
indra/test/CMakeLists.txt
+
0
−
1
View file @
423f5b00
...
...
@@ -58,7 +58,6 @@ set(test_SOURCE_FILES
llstreamtools_tut.cpp
lltemplatemessagebuilder_tut.cpp
lltimestampcache_tut.cpp
lltiming_tut.cpp
lltranscode_tut.cpp
lltreeiterators_tut.cpp
lltut.cpp
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment