VOXELFORMAT: extended magicavoxel vox test

... with a model made by lordkromdarr
master
Martin Gerhardy 2022-02-09 20:43:19 +01:00
parent e716a96ac4
commit 58baf12148
4 changed files with 12793 additions and 0 deletions

BIN
data/tests/8ontop.vox Normal file

Binary file not shown.

View File

@ -58,6 +58,7 @@ set(TEST_SRCS
tests/VXRFormatTest.cpp
tests/VXMFormatTest.cpp
tests/8ontop.h
tests/vox_character.h
tests/vox_glasses.h
)
@ -81,6 +82,7 @@ set(TEST_FILES
tests/test.gox
tests/test.vxm
tests/test2.vxm
tests/8ontop.vox
tests/cw.cub
tests/r.0.-2.mca
tests/rgb.vxl

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@
#include "voxelformat/VolumeFormat.h"
#include "vox_character.h"
#include "vox_glasses.h"
#include "8ontop.h"
namespace voxel {
@ -62,6 +63,43 @@ TEST_F(VoxFormatTest, testLoadGlasses) {
}
}
TEST_F(VoxFormatTest, testLoad8OnTop) {
VoxFormat f;
const io::FilePtr &file = open("8ontop.vox");
ASSERT_TRUE(file->validHandle());
io::FileStream stream(file);
voxel::SceneGraph sceneGraph;
ASSERT_TRUE(voxelformat::loadFormat(file->name(), stream, sceneGraph));
ASSERT_EQ(72u, sceneGraph.size());
// dump(file->fileName(), sceneGraph);
core::SharedPtr<voxel::RawVolume> volumes[] = {
eightontop_0::create(), eightontop_1::create(), eightontop_2::create(), eightontop_3::create(),
eightontop_4::create(), eightontop_5::create(), eightontop_6::create(), eightontop_7::create(),
eightontop_8::create(), eightontop_9::create(), eightontop_10::create(), eightontop_11::create(),
eightontop_12::create(), eightontop_13::create(), eightontop_14::create(), eightontop_15::create(),
eightontop_16::create(), eightontop_17::create(), eightontop_18::create(), eightontop_19::create(),
eightontop_20::create(), eightontop_21::create(), eightontop_22::create(), eightontop_23::create(),
eightontop_24::create(), eightontop_25::create(), eightontop_26::create(), eightontop_27::create(),
eightontop_28::create(), eightontop_29::create(), eightontop_30::create(), eightontop_31::create(),
eightontop_32::create(), eightontop_33::create(), eightontop_34::create(), eightontop_35::create(),
eightontop_36::create(), eightontop_37::create(), eightontop_38::create(), eightontop_39::create(),
eightontop_40::create(), eightontop_41::create(), eightontop_42::create(), eightontop_43::create(),
eightontop_44::create(), eightontop_45::create(), eightontop_46::create(), eightontop_47::create(),
eightontop_48::create(), eightontop_49::create(), eightontop_50::create(), eightontop_51::create(),
eightontop_52::create(), eightontop_53::create(), eightontop_54::create(), eightontop_55::create(),
eightontop_56::create(), eightontop_57::create(), eightontop_58::create(), eightontop_59::create(),
eightontop_60::create(), eightontop_61::create(), eightontop_62::create(), eightontop_63::create(),
eightontop_64::create(), eightontop_65::create(), eightontop_66::create(), eightontop_67::create(),
eightontop_68::create(), eightontop_69::create(), eightontop_70::create(), eightontop_71::create(),
};
ASSERT_EQ(lengthof(volumes), (int)sceneGraph.size());
for (int i = 0; i < lengthof(volumes); ++i) {
const voxel::RawVolume &v1 = *volumes[i].get();
const voxel::RawVolume &v2 = *sceneGraph[i]->volume();
EXPECT_TRUE(volumeComparator(v1, v2, true, true)) << "Volumes differ: " << v1 << v2;
}
}
TEST_F(VoxFormatTest, testLoadRGB) {
VoxFormat f;
std::unique_ptr<RawVolume> volume(load("rgb.vox", f));