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
8a289a16
Commit
8a289a16
authored
13 years ago
by
Logan Dethrow
Browse files
Options
Downloads
Patches
Plain Diff
Re-enabled and fixed llsd_new_tut.cpp by copying the fixed version from the server test directory.
parent
3151b6ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/test/CMakeLists.txt
+1
-1
1 addition, 1 deletion
indra/test/CMakeLists.txt
indra/test/llsd_new_tut.cpp
+56
-13
56 additions, 13 deletions
indra/test/llsd_new_tut.cpp
with
57 additions
and
14 deletions
indra/test/CMakeLists.txt
+
1
−
1
View file @
8a289a16
...
@@ -48,7 +48,7 @@ set(test_SOURCE_FILES
...
@@ -48,7 +48,7 @@ set(test_SOURCE_FILES
llscriptresource_tut.cpp
llscriptresource_tut.cpp
llsdmessagebuilder_tut.cpp
llsdmessagebuilder_tut.cpp
llsdmessagereader_tut.cpp
llsdmessagereader_tut.cpp
#
llsd_new_tut.cpp # Fails [LLSD(new), 4] fail: 'NaN to string: expected 'nan' actual '-nan''
llsd_new_tut.cpp
# Fails [LLSD(new), 4] fail: 'NaN to string: expected 'nan' actual '-nan''
llsdutil_tut.cpp
llsdutil_tut.cpp
llservicebuilder_tut.cpp
llservicebuilder_tut.cpp
llstreamtools_tut.cpp
llstreamtools_tut.cpp
...
...
This diff is collapsed.
Click to expand it.
indra/test/llsd_new_tut.cpp
+
56
−
13
View file @
8a289a16
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Second Life Viewer Source Code
* Copyright (C) 20
1
0, Linden Research, Inc.
* Copyright (C) 200
6-2011
, Linden Research, Inc.
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -32,6 +32,17 @@
...
@@ -32,6 +32,17 @@
#include
"llsdtraits.h"
#include
"llsdtraits.h"
#include
"llstring.h"
#include
"llstring.h"
#if LL_WINDOWS
#include
<float.h>
namespace
std
{
int
fpclassify
(
double
x
)
{
return
_fpclass
(
x
);
}
}
#endif
namespace
tut
namespace
tut
{
{
class
SDCleanupCheck
class
SDCleanupCheck
...
@@ -218,19 +229,16 @@ namespace tut
...
@@ -218,19 +229,16 @@ namespace tut
}
}
else
else
{
{
// TODO: Fix on windows....
int
left
=
std
::
fpclassify
(
v
.
asReal
());
#ifndef LL_WINDOWS
int
right
=
std
::
fpclassify
(
eReal
);
# if !defined(fpclassify) && __GNUC__ >= 3
# define FPCLASSIFY_NAMESPACE std::
# else
# define FPCLASSIFY_NAMESPACE
# endif
int
left
=
FPCLASSIFY_NAMESPACE
fpclassify
(
v
.
asReal
());
int
right
=
FPCLASSIFY_NAMESPACE
fpclassify
(
eReal
);
ensure_equals
(
s
+
" to real"
,
left
,
right
);
ensure_equals
(
s
+
" to real"
,
left
,
right
);
ensure_equals
(
s
+
" to string"
,
v
.
asString
(),
eString
);
// ensure_equals(s+" to string", v.asString(), eString);
#endif
// I've commented this check out, since there doesn't
// seem to be uniform string representation for NaN on
// all platforms. For example, on my Ubuntu 8.10 laptop
// with libc 2.11.1, sqrt(-1.0) will return '-nan', not
// 'nan'.
}
}
}
}
...
@@ -742,6 +750,42 @@ namespace tut
...
@@ -742,6 +750,42 @@ namespace tut
LLSD
w
=
v
;
LLSD
w
=
v
;
w
=
"nice day"
;
w
=
"nice day"
;
}
}
{
SDAllocationCheck
check
(
"shared values test for threaded work"
,
9
);
//U32 start_llsd_count = LLSD::outstandingCount();
LLSD
m
=
LLSD
::
emptyMap
();
m
[
"one"
]
=
1
;
m
[
"two"
]
=
2
;
m
[
"one_copy"
]
=
m
[
"one"
];
// 3 (m, "one" and "two")
m
[
"undef_one"
]
=
LLSD
();
m
[
"undef_two"
]
=
LLSD
();
m
[
"undef_one_copy"
]
=
m
[
"undef_one"
];
{
// Ensure first_array gets freed to avoid counting it
LLSD
first_array
=
LLSD
::
emptyArray
();
first_array
.
append
(
1.0
f
);
first_array
.
append
(
2.0
f
);
first_array
.
append
(
3.0
f
);
// 7
m
[
"array"
]
=
first_array
;
m
[
"array_clone"
]
=
first_array
;
m
[
"array_copy"
]
=
m
[
"array"
];
// 7
}
m
[
"string_one"
]
=
"string one value"
;
m
[
"string_two"
]
=
"string two value"
;
m
[
"string_one_copy"
]
=
m
[
"string_one"
];
// 9
//U32 llsd_object_count = LLSD::outstandingCount();
//std::cout << "Using " << (llsd_object_count - start_llsd_count) << " LLSD objects" << std::endl;
//m.dumpStats();
}
}
}
template
<
>
template
<
>
template
<
>
template
<
>
...
@@ -769,4 +813,3 @@ namespace tut
...
@@ -769,4 +813,3 @@ namespace tut
test serializations
test serializations
*/
*/
}
}
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