Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Niflib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Kim
Niflib
Commits
237d7751
Commit
237d7751
authored
12 years ago
by
Amorilia
Browse files
Options
Downloads
Patches
Plain Diff
Added test for tangent space flag (fails at the moment).
parent
acee86ba
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/CMakeLists.txt
+2
-1
2 additions, 1 deletion
test/CMakeLists.txt
test/numuvsets_test.cpp
+51
-0
51 additions, 0 deletions
test/numuvsets_test.cpp
with
53 additions
and
1 deletion
test/CMakeLists.txt
+
2
−
1
View file @
237d7751
...
...
@@ -11,7 +11,8 @@ foreach(TEST
ninode_test
skin_test
missing_link_stack_test
trishape_test
)
trishape_test
numuvsets_test
)
add_executable
(
${
TEST
}
${
TEST
}
.cpp
)
target_link_libraries
(
${
TEST
}
${
Boost_UNIT_TEST_FRAMEWORK_LIBRARY
}
niflib
)
add_test
(
niflib::
${
TEST
}
${
TEST
}
)
...
...
This diff is collapsed.
Click to expand it.
test/numuvsets_test.cpp
0 → 100644
+
51
−
0
View file @
237d7751
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MAIN
#include
<boost/test/unit_test.hpp>
#include
<sstream>
// stringstream
// evil hack to allow testing of private and protected data
#define private public
#define protected public
#include
"niflib.h"
#include
"obj/NiNode.h"
#include
"obj/NiTriShape.h"
#include
"obj/NiTriShapeData.h"
using
namespace
Niflib
;
using
namespace
std
;
BOOST_AUTO_TEST_SUITE
(
numuvsets_test_suite
)
BOOST_AUTO_TEST_CASE
(
numuvsets_write_test
)
{
stringstream
ss
;
stringstream
ss2
;
// create a simple nif tree with a trishape
NiNodeRef
root
=
new
NiNode
;
NiTriShapeRef
shape
=
new
NiTriShape
;
NiTriShapeDataRef
data
=
new
NiTriShapeData
;
// set hierarchy
shape
->
SetData
(
data
);
root
->
AddChild
(
DynamicCast
<
NiAVObject
>
(
shape
));
// set flag
data
->
SetTspaceFlag
(
1
);
// write and read
NiObjectRef
obj
;
BOOST_CHECK_NO_THROW
(
WriteNifTree
(
ss
,
root
,
NifInfo
(
VER_20_0_0_5
)));
ss
.
seekg
(
0
);
BOOST_CHECK_NO_THROW
(
obj
=
ReadNifTree
(
ss
));
// check flag
root
=
DynamicCast
<
NiNode
>
(
obj
);
BOOST_REQUIRE
(
root
!=
NULL
);
BOOST_REQUIRE_EQUAL
(
root
->
GetChildren
().
size
(),
1
);
shape
=
DynamicCast
<
NiTriShape
>
(
root
->
GetChildren
()[
0
]);
BOOST_REQUIRE
(
shape
!=
NULL
);
data
=
DynamicCast
<
NiTriShapeData
>
(
shape
->
GetData
());
BOOST_REQUIRE
(
data
!=
NULL
);
BOOST_CHECK_EQUAL
(
data
->
GetTspaceFlag
(),
1
);
}
BOOST_AUTO_TEST_SUITE_END
()
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