Skip to content

Commit

Permalink
Added enum_deep test for C++ => works
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyCat committed Jun 1, 2018
1 parent c57a37d commit 5c4e3b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/cpp_stl/CMakeLists.txt
Expand Up @@ -157,6 +157,7 @@ set(SPEC_SOURCES
test_params_pass_usertype.cpp
test_nested_types3.cpp
test_cast_nested.cpp
test_enum_deep.cpp
)

set(PREREQ_SOURCES
Expand Down Expand Up @@ -308,6 +309,7 @@ set(KS_SOURCES
${KS_PATH}/params_pass_usertype.cpp
${KS_PATH}/nested_types3.cpp
${KS_PATH}/cast_nested.cpp
${KS_PATH}/enum_deep.cpp

${KS_PATH}/imported_1.cpp
${KS_PATH}/imported_2.cpp
Expand Down
16 changes: 16 additions & 0 deletions spec/cpp_stl/test_enum_deep.cpp
@@ -0,0 +1,16 @@
#include <boost/test/unit_test.hpp>
#include <enum_deep.h>
#include <iostream>
#include <fstream>
#include <vector>

BOOST_AUTO_TEST_CASE(test_enum_deep) {
std::ifstream ifs("src/enum_0.bin", std::ifstream::binary);
kaitai::kstream ks(&ifs);
enum_deep_t* r = new enum_deep_t(&ks);

BOOST_CHECK_EQUAL(r->pet_1(), enum_deep_t::container1_t::ANIMAL_CAT);
BOOST_CHECK_EQUAL(r->pet_2(), enum_deep_t::container1_t::container2_t::ANIMAL_HARE);

delete r;
}

0 comments on commit 5c4e3b4

Please sign in to comment.