diff --git a/spec/cpp_stl_11/test_valid_fail_repeat_anyof_int.cpp b/spec/cpp_stl_11/test_valid_fail_repeat_anyof_int.cpp new file mode 100644 index 000000000..9a804fa21 --- /dev/null +++ b/spec/cpp_stl_11/test_valid_fail_repeat_anyof_int.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_anyof_int.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_anyof_int) { + std::ifstream ifs("src/process_coerce_bytes.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_anyof_int_t* r = nullptr; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_anyof_int_t(&ks), + kaitai::validation_not_any_of_error + ); + + delete r; +} diff --git a/spec/cpp_stl_11/test_valid_fail_repeat_contents.cpp b/spec/cpp_stl_11/test_valid_fail_repeat_contents.cpp new file mode 100644 index 000000000..379319b69 --- /dev/null +++ b/spec/cpp_stl_11/test_valid_fail_repeat_contents.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_contents.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_contents) { + std::ifstream ifs("src/bcd_user_type_be.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_contents_t* r = nullptr; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_contents_t(&ks), + kaitai::validation_not_equal_error + ); + + delete r; +} diff --git a/spec/cpp_stl_11/test_valid_fail_repeat_eq_int.cpp b/spec/cpp_stl_11/test_valid_fail_repeat_eq_int.cpp new file mode 100644 index 000000000..3a6ad2ab6 --- /dev/null +++ b/spec/cpp_stl_11/test_valid_fail_repeat_eq_int.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_eq_int.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_eq_int) { + std::ifstream ifs("src/bcd_user_type_be.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_eq_int_t* r = nullptr; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_eq_int_t(&ks), + kaitai::validation_not_equal_error + ); + + delete r; +} diff --git a/spec/cpp_stl_11/test_valid_fail_repeat_expr.cpp b/spec/cpp_stl_11/test_valid_fail_repeat_expr.cpp new file mode 100644 index 000000000..89f11a745 --- /dev/null +++ b/spec/cpp_stl_11/test_valid_fail_repeat_expr.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_expr.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_expr) { + std::ifstream ifs("src/bcd_user_type_be.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_expr_t* r = nullptr; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_expr_t(&ks), + kaitai::validation_expr_error + ); + + delete r; +} diff --git a/spec/cpp_stl_11/test_valid_fail_repeat_inst.cpp b/spec/cpp_stl_11/test_valid_fail_repeat_inst.cpp new file mode 100644 index 000000000..27aa1e345 --- /dev/null +++ b/spec/cpp_stl_11/test_valid_fail_repeat_inst.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_inst.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_inst) { + std::ifstream ifs("src/bcd_user_type_be.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_inst_t* r = nullptr; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_inst_t(&ks), + kaitai::validation_not_equal_error + ); + + delete r; +} diff --git a/spec/cpp_stl_11/test_valid_fail_repeat_max_int.cpp b/spec/cpp_stl_11/test_valid_fail_repeat_max_int.cpp new file mode 100644 index 000000000..dcab3dcbb --- /dev/null +++ b/spec/cpp_stl_11/test_valid_fail_repeat_max_int.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_max_int.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_max_int) { + std::ifstream ifs("src/nav_parent_switch.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_max_int_t* r = nullptr; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_max_int_t(&ks), + kaitai::validation_greater_than_error + ); + + delete r; +} diff --git a/spec/cpp_stl_11/test_valid_fail_repeat_min_int.cpp b/spec/cpp_stl_11/test_valid_fail_repeat_min_int.cpp new file mode 100644 index 000000000..a8e49d540 --- /dev/null +++ b/spec/cpp_stl_11/test_valid_fail_repeat_min_int.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_min_int.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_min_int) { + std::ifstream ifs("src/process_coerce_bytes.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_min_int_t* r = nullptr; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_min_int_t(&ks), + kaitai::validation_less_than_error + ); + + delete r; +} diff --git a/spec/cpp_stl_98/test_valid_fail_repeat_anyof_int.cpp b/spec/cpp_stl_98/test_valid_fail_repeat_anyof_int.cpp new file mode 100644 index 000000000..0bc5368f0 --- /dev/null +++ b/spec/cpp_stl_98/test_valid_fail_repeat_anyof_int.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_anyof_int.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_anyof_int) { + std::ifstream ifs("src/process_coerce_bytes.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_anyof_int_t* r = 0; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_anyof_int_t(&ks), + kaitai::validation_not_any_of_error + ); + + delete r; +} diff --git a/spec/cpp_stl_98/test_valid_fail_repeat_contents.cpp b/spec/cpp_stl_98/test_valid_fail_repeat_contents.cpp new file mode 100644 index 000000000..2f5c1eae1 --- /dev/null +++ b/spec/cpp_stl_98/test_valid_fail_repeat_contents.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_contents.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_contents) { + std::ifstream ifs("src/bcd_user_type_be.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_contents_t* r = 0; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_contents_t(&ks), + kaitai::validation_not_equal_error + ); + + delete r; +} diff --git a/spec/cpp_stl_98/test_valid_fail_repeat_eq_int.cpp b/spec/cpp_stl_98/test_valid_fail_repeat_eq_int.cpp new file mode 100644 index 000000000..8d158516a --- /dev/null +++ b/spec/cpp_stl_98/test_valid_fail_repeat_eq_int.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_eq_int.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_eq_int) { + std::ifstream ifs("src/bcd_user_type_be.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_eq_int_t* r = 0; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_eq_int_t(&ks), + kaitai::validation_not_equal_error + ); + + delete r; +} diff --git a/spec/cpp_stl_98/test_valid_fail_repeat_expr.cpp b/spec/cpp_stl_98/test_valid_fail_repeat_expr.cpp new file mode 100644 index 000000000..becf616ce --- /dev/null +++ b/spec/cpp_stl_98/test_valid_fail_repeat_expr.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_expr.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_expr) { + std::ifstream ifs("src/bcd_user_type_be.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_expr_t* r = 0; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_expr_t(&ks), + kaitai::validation_expr_error + ); + + delete r; +} diff --git a/spec/cpp_stl_98/test_valid_fail_repeat_inst.cpp b/spec/cpp_stl_98/test_valid_fail_repeat_inst.cpp new file mode 100644 index 000000000..d6df1e867 --- /dev/null +++ b/spec/cpp_stl_98/test_valid_fail_repeat_inst.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_inst.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_inst) { + std::ifstream ifs("src/bcd_user_type_be.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_inst_t* r = 0; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_inst_t(&ks), + kaitai::validation_not_equal_error + ); + + delete r; +} diff --git a/spec/cpp_stl_98/test_valid_fail_repeat_max_int.cpp b/spec/cpp_stl_98/test_valid_fail_repeat_max_int.cpp new file mode 100644 index 000000000..6486bffe8 --- /dev/null +++ b/spec/cpp_stl_98/test_valid_fail_repeat_max_int.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_max_int.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_max_int) { + std::ifstream ifs("src/nav_parent_switch.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_max_int_t* r = 0; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_max_int_t(&ks), + kaitai::validation_greater_than_error + ); + + delete r; +} diff --git a/spec/cpp_stl_98/test_valid_fail_repeat_min_int.cpp b/spec/cpp_stl_98/test_valid_fail_repeat_min_int.cpp new file mode 100644 index 000000000..5effecfaa --- /dev/null +++ b/spec/cpp_stl_98/test_valid_fail_repeat_min_int.cpp @@ -0,0 +1,20 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +#include +#include "valid_fail_repeat_min_int.h" +#include +#include +#include +#include "kaitai/exceptions.h" + +BOOST_AUTO_TEST_CASE(test_valid_fail_repeat_min_int) { + std::ifstream ifs("src/process_coerce_bytes.bin", std::ifstream::binary); + kaitai::kstream ks(&ifs); + valid_fail_repeat_min_int_t* r = 0; + BOOST_CHECK_THROW( + r = new valid_fail_repeat_min_int_t(&ks), + kaitai::validation_less_than_error + ); + + delete r; +} diff --git a/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatAnyofInt.cs b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatAnyofInt.cs new file mode 100644 index 000000000..fc39f2446 --- /dev/null +++ b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatAnyofInt.cs @@ -0,0 +1,21 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +using NUnit.Framework; + +namespace Kaitai +{ + [TestFixture] + public class SpecValidFailRepeatAnyofInt : CommonSpec + { + [Test] + public void TestValidFailRepeatAnyofInt() + { + Assert.Throws( + delegate + { + ValidFailRepeatAnyofInt.FromFile(SourceFile("process_coerce_bytes.bin")); + } + ); + } + } +} diff --git a/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatContents.cs b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatContents.cs new file mode 100644 index 000000000..7f724537b --- /dev/null +++ b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatContents.cs @@ -0,0 +1,21 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +using NUnit.Framework; + +namespace Kaitai +{ + [TestFixture] + public class SpecValidFailRepeatContents : CommonSpec + { + [Test] + public void TestValidFailRepeatContents() + { + Assert.Throws( + delegate + { + ValidFailRepeatContents.FromFile(SourceFile("bcd_user_type_be.bin")); + } + ); + } + } +} diff --git a/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatEqInt.cs b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatEqInt.cs new file mode 100644 index 000000000..38d8ce2f6 --- /dev/null +++ b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatEqInt.cs @@ -0,0 +1,21 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +using NUnit.Framework; + +namespace Kaitai +{ + [TestFixture] + public class SpecValidFailRepeatEqInt : CommonSpec + { + [Test] + public void TestValidFailRepeatEqInt() + { + Assert.Throws( + delegate + { + ValidFailRepeatEqInt.FromFile(SourceFile("bcd_user_type_be.bin")); + } + ); + } + } +} diff --git a/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatExpr.cs b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatExpr.cs new file mode 100644 index 000000000..3e9fc5426 --- /dev/null +++ b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatExpr.cs @@ -0,0 +1,21 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +using NUnit.Framework; + +namespace Kaitai +{ + [TestFixture] + public class SpecValidFailRepeatExpr : CommonSpec + { + [Test] + public void TestValidFailRepeatExpr() + { + Assert.Throws( + delegate + { + ValidFailRepeatExpr.FromFile(SourceFile("bcd_user_type_be.bin")); + } + ); + } + } +} diff --git a/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatInst.cs b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatInst.cs new file mode 100644 index 000000000..4998cde55 --- /dev/null +++ b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatInst.cs @@ -0,0 +1,21 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +using NUnit.Framework; + +namespace Kaitai +{ + [TestFixture] + public class SpecValidFailRepeatInst : CommonSpec + { + [Test] + public void TestValidFailRepeatInst() + { + Assert.Throws( + delegate + { + ValidFailRepeatInst.FromFile(SourceFile("bcd_user_type_be.bin")); + } + ); + } + } +} diff --git a/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatMaxInt.cs b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatMaxInt.cs new file mode 100644 index 000000000..6613e3912 --- /dev/null +++ b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatMaxInt.cs @@ -0,0 +1,21 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +using NUnit.Framework; + +namespace Kaitai +{ + [TestFixture] + public class SpecValidFailRepeatMaxInt : CommonSpec + { + [Test] + public void TestValidFailRepeatMaxInt() + { + Assert.Throws( + delegate + { + ValidFailRepeatMaxInt.FromFile(SourceFile("nav_parent_switch.bin")); + } + ); + } + } +} diff --git a/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatMinInt.cs b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatMinInt.cs new file mode 100644 index 000000000..de008b1ce --- /dev/null +++ b/spec/csharp/kaitai_struct_csharp_tests/tests/SpecValidFailRepeatMinInt.cs @@ -0,0 +1,21 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +using NUnit.Framework; + +namespace Kaitai +{ + [TestFixture] + public class SpecValidFailRepeatMinInt : CommonSpec + { + [Test] + public void TestValidFailRepeatMinInt() + { + Assert.Throws( + delegate + { + ValidFailRepeatMinInt.FromFile(SourceFile("process_coerce_bytes.bin")); + } + ); + } + } +} diff --git a/spec/go/valid_fail_repeat_anyof_int_test.go b/spec/go/valid_fail_repeat_anyof_int_test.go new file mode 100644 index 000000000..0865c7f94 --- /dev/null +++ b/spec/go/valid_fail_repeat_anyof_int_test.go @@ -0,0 +1,31 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package spec + +import ( + "runtime/debug" + "os" + "testing" + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + . "test_formats" + "github.com/stretchr/testify/assert" +) + +func TestValidFailRepeatAnyofInt(t *testing.T) { + defer func() { + if r := recover(); r != nil { + debug.PrintStack() + t.Fatal("unexpected panic:", r) + } + }() + f, err := os.Open("../../src/process_coerce_bytes.bin") + if err != nil { + t.Fatal(err) + } + s := kaitai.NewStream(f) + var r ValidFailRepeatAnyofInt + err = r.Read(s, &r, &r) + assert.Error(t, err) + var wantErr kaitai.ValidationNotAnyOfError + assert.ErrorAs(t, err, &wantErr) +} diff --git a/spec/go/valid_fail_repeat_contents_test.go b/spec/go/valid_fail_repeat_contents_test.go new file mode 100644 index 000000000..19250f78d --- /dev/null +++ b/spec/go/valid_fail_repeat_contents_test.go @@ -0,0 +1,31 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package spec + +import ( + "runtime/debug" + "os" + "testing" + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + . "test_formats" + "github.com/stretchr/testify/assert" +) + +func TestValidFailRepeatContents(t *testing.T) { + defer func() { + if r := recover(); r != nil { + debug.PrintStack() + t.Fatal("unexpected panic:", r) + } + }() + f, err := os.Open("../../src/bcd_user_type_be.bin") + if err != nil { + t.Fatal(err) + } + s := kaitai.NewStream(f) + var r ValidFailRepeatContents + err = r.Read(s, &r, &r) + assert.Error(t, err) + var wantErr kaitai.ValidationNotEqualError + assert.ErrorAs(t, err, &wantErr) +} diff --git a/spec/go/valid_fail_repeat_eq_int_test.go b/spec/go/valid_fail_repeat_eq_int_test.go new file mode 100644 index 000000000..a89f28741 --- /dev/null +++ b/spec/go/valid_fail_repeat_eq_int_test.go @@ -0,0 +1,31 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package spec + +import ( + "runtime/debug" + "os" + "testing" + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + . "test_formats" + "github.com/stretchr/testify/assert" +) + +func TestValidFailRepeatEqInt(t *testing.T) { + defer func() { + if r := recover(); r != nil { + debug.PrintStack() + t.Fatal("unexpected panic:", r) + } + }() + f, err := os.Open("../../src/bcd_user_type_be.bin") + if err != nil { + t.Fatal(err) + } + s := kaitai.NewStream(f) + var r ValidFailRepeatEqInt + err = r.Read(s, &r, &r) + assert.Error(t, err) + var wantErr kaitai.ValidationNotEqualError + assert.ErrorAs(t, err, &wantErr) +} diff --git a/spec/go/valid_fail_repeat_expr_test.go b/spec/go/valid_fail_repeat_expr_test.go new file mode 100644 index 000000000..53945619c --- /dev/null +++ b/spec/go/valid_fail_repeat_expr_test.go @@ -0,0 +1,31 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package spec + +import ( + "runtime/debug" + "os" + "testing" + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + . "test_formats" + "github.com/stretchr/testify/assert" +) + +func TestValidFailRepeatExpr(t *testing.T) { + defer func() { + if r := recover(); r != nil { + debug.PrintStack() + t.Fatal("unexpected panic:", r) + } + }() + f, err := os.Open("../../src/bcd_user_type_be.bin") + if err != nil { + t.Fatal(err) + } + s := kaitai.NewStream(f) + var r ValidFailRepeatExpr + err = r.Read(s, &r, &r) + assert.Error(t, err) + var wantErr kaitai.ValidationExprError + assert.ErrorAs(t, err, &wantErr) +} diff --git a/spec/go/valid_fail_repeat_inst_test.go b/spec/go/valid_fail_repeat_inst_test.go new file mode 100644 index 000000000..590cf0081 --- /dev/null +++ b/spec/go/valid_fail_repeat_inst_test.go @@ -0,0 +1,31 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package spec + +import ( + "runtime/debug" + "os" + "testing" + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + . "test_formats" + "github.com/stretchr/testify/assert" +) + +func TestValidFailRepeatInst(t *testing.T) { + defer func() { + if r := recover(); r != nil { + debug.PrintStack() + t.Fatal("unexpected panic:", r) + } + }() + f, err := os.Open("../../src/bcd_user_type_be.bin") + if err != nil { + t.Fatal(err) + } + s := kaitai.NewStream(f) + var r ValidFailRepeatInst + err = r.Read(s, &r, &r) + assert.Error(t, err) + var wantErr kaitai.ValidationNotEqualError + assert.ErrorAs(t, err, &wantErr) +} diff --git a/spec/go/valid_fail_repeat_max_int_test.go b/spec/go/valid_fail_repeat_max_int_test.go new file mode 100644 index 000000000..bcea2f3c4 --- /dev/null +++ b/spec/go/valid_fail_repeat_max_int_test.go @@ -0,0 +1,31 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package spec + +import ( + "runtime/debug" + "os" + "testing" + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + . "test_formats" + "github.com/stretchr/testify/assert" +) + +func TestValidFailRepeatMaxInt(t *testing.T) { + defer func() { + if r := recover(); r != nil { + debug.PrintStack() + t.Fatal("unexpected panic:", r) + } + }() + f, err := os.Open("../../src/nav_parent_switch.bin") + if err != nil { + t.Fatal(err) + } + s := kaitai.NewStream(f) + var r ValidFailRepeatMaxInt + err = r.Read(s, &r, &r) + assert.Error(t, err) + var wantErr kaitai.ValidationGreaterThanError + assert.ErrorAs(t, err, &wantErr) +} diff --git a/spec/go/valid_fail_repeat_min_int_test.go b/spec/go/valid_fail_repeat_min_int_test.go new file mode 100644 index 000000000..3edaf2ba6 --- /dev/null +++ b/spec/go/valid_fail_repeat_min_int_test.go @@ -0,0 +1,31 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package spec + +import ( + "runtime/debug" + "os" + "testing" + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + . "test_formats" + "github.com/stretchr/testify/assert" +) + +func TestValidFailRepeatMinInt(t *testing.T) { + defer func() { + if r := recover(); r != nil { + debug.PrintStack() + t.Fatal("unexpected panic:", r) + } + }() + f, err := os.Open("../../src/process_coerce_bytes.bin") + if err != nil { + t.Fatal(err) + } + s := kaitai.NewStream(f) + var r ValidFailRepeatMinInt + err = r.Read(s, &r, &r) + assert.Error(t, err) + var wantErr kaitai.ValidationLessThanError + assert.ErrorAs(t, err, &wantErr) +} diff --git a/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatAnyofInt.java b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatAnyofInt.java new file mode 100644 index 000000000..c64cafebf --- /dev/null +++ b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatAnyofInt.java @@ -0,0 +1,15 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package io.kaitai.struct.spec; + +import io.kaitai.struct.testformats.ValidFailRepeatAnyofInt; +import org.testng.annotations.Test; +import static org.testng.Assert.*; +import io.kaitai.struct.KaitaiStream; +public class TestValidFailRepeatAnyofInt extends CommonSpec { + + @Test(expectedExceptions = KaitaiStream.ValidationNotAnyOfError.class) + public void testValidFailRepeatAnyofInt() throws Exception { + ValidFailRepeatAnyofInt r = ValidFailRepeatAnyofInt.fromFile(SRC_DIR + "process_coerce_bytes.bin"); + } +} diff --git a/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatContents.java b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatContents.java new file mode 100644 index 000000000..07a478451 --- /dev/null +++ b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatContents.java @@ -0,0 +1,15 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package io.kaitai.struct.spec; + +import io.kaitai.struct.testformats.ValidFailRepeatContents; +import org.testng.annotations.Test; +import static org.testng.Assert.*; +import io.kaitai.struct.KaitaiStream; +public class TestValidFailRepeatContents extends CommonSpec { + + @Test(expectedExceptions = KaitaiStream.ValidationNotEqualError.class) + public void testValidFailRepeatContents() throws Exception { + ValidFailRepeatContents r = ValidFailRepeatContents.fromFile(SRC_DIR + "bcd_user_type_be.bin"); + } +} diff --git a/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatEqInt.java b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatEqInt.java new file mode 100644 index 000000000..7e2e5a14e --- /dev/null +++ b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatEqInt.java @@ -0,0 +1,15 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package io.kaitai.struct.spec; + +import io.kaitai.struct.testformats.ValidFailRepeatEqInt; +import org.testng.annotations.Test; +import static org.testng.Assert.*; +import io.kaitai.struct.KaitaiStream; +public class TestValidFailRepeatEqInt extends CommonSpec { + + @Test(expectedExceptions = KaitaiStream.ValidationNotEqualError.class) + public void testValidFailRepeatEqInt() throws Exception { + ValidFailRepeatEqInt r = ValidFailRepeatEqInt.fromFile(SRC_DIR + "bcd_user_type_be.bin"); + } +} diff --git a/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatExpr.java b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatExpr.java new file mode 100644 index 000000000..1a29c5dd0 --- /dev/null +++ b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatExpr.java @@ -0,0 +1,15 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package io.kaitai.struct.spec; + +import io.kaitai.struct.testformats.ValidFailRepeatExpr; +import org.testng.annotations.Test; +import static org.testng.Assert.*; +import io.kaitai.struct.KaitaiStream; +public class TestValidFailRepeatExpr extends CommonSpec { + + @Test(expectedExceptions = KaitaiStream.ValidationExprError.class) + public void testValidFailRepeatExpr() throws Exception { + ValidFailRepeatExpr r = ValidFailRepeatExpr.fromFile(SRC_DIR + "bcd_user_type_be.bin"); + } +} diff --git a/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatInst.java b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatInst.java new file mode 100644 index 000000000..4d927debb --- /dev/null +++ b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatInst.java @@ -0,0 +1,15 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package io.kaitai.struct.spec; + +import io.kaitai.struct.testformats.ValidFailRepeatInst; +import org.testng.annotations.Test; +import static org.testng.Assert.*; +import io.kaitai.struct.KaitaiStream; +public class TestValidFailRepeatInst extends CommonSpec { + + @Test(expectedExceptions = KaitaiStream.ValidationNotEqualError.class) + public void testValidFailRepeatInst() throws Exception { + ValidFailRepeatInst r = ValidFailRepeatInst.fromFile(SRC_DIR + "bcd_user_type_be.bin"); + } +} diff --git a/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatMaxInt.java b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatMaxInt.java new file mode 100644 index 000000000..ee2081428 --- /dev/null +++ b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatMaxInt.java @@ -0,0 +1,15 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package io.kaitai.struct.spec; + +import io.kaitai.struct.testformats.ValidFailRepeatMaxInt; +import org.testng.annotations.Test; +import static org.testng.Assert.*; +import io.kaitai.struct.KaitaiStream; +public class TestValidFailRepeatMaxInt extends CommonSpec { + + @Test(expectedExceptions = KaitaiStream.ValidationGreaterThanError.class) + public void testValidFailRepeatMaxInt() throws Exception { + ValidFailRepeatMaxInt r = ValidFailRepeatMaxInt.fromFile(SRC_DIR + "nav_parent_switch.bin"); + } +} diff --git a/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatMinInt.java b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatMinInt.java new file mode 100644 index 000000000..14a9c92ae --- /dev/null +++ b/spec/java/src/io/kaitai/struct/spec/TestValidFailRepeatMinInt.java @@ -0,0 +1,15 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +package io.kaitai.struct.spec; + +import io.kaitai.struct.testformats.ValidFailRepeatMinInt; +import org.testng.annotations.Test; +import static org.testng.Assert.*; +import io.kaitai.struct.KaitaiStream; +public class TestValidFailRepeatMinInt extends CommonSpec { + + @Test(expectedExceptions = KaitaiStream.ValidationLessThanError.class) + public void testValidFailRepeatMinInt() throws Exception { + ValidFailRepeatMinInt r = ValidFailRepeatMinInt.fromFile(SRC_DIR + "process_coerce_bytes.bin"); + } +} diff --git a/spec/javascript/test_valid_fail_repeat_anyof_int.js b/spec/javascript/test_valid_fail_repeat_anyof_int.js new file mode 100644 index 000000000..dd98174a2 --- /dev/null +++ b/spec/javascript/test_valid_fail_repeat_anyof_int.js @@ -0,0 +1,7 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +var assert = require('assert'); +var testHelperThrows = require('testHelperThrows'); +var KaitaiStream = require('kaitai-struct/KaitaiStream'); + +testHelperThrows('ValidFailRepeatAnyofInt', 'src/process_coerce_bytes.bin', KaitaiStream.ValidationNotAnyOfError); diff --git a/spec/javascript/test_valid_fail_repeat_contents.js b/spec/javascript/test_valid_fail_repeat_contents.js new file mode 100644 index 000000000..cc4e3baed --- /dev/null +++ b/spec/javascript/test_valid_fail_repeat_contents.js @@ -0,0 +1,7 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +var assert = require('assert'); +var testHelperThrows = require('testHelperThrows'); +var KaitaiStream = require('kaitai-struct/KaitaiStream'); + +testHelperThrows('ValidFailRepeatContents', 'src/bcd_user_type_be.bin', KaitaiStream.ValidationNotEqualError); diff --git a/spec/javascript/test_valid_fail_repeat_eq_int.js b/spec/javascript/test_valid_fail_repeat_eq_int.js new file mode 100644 index 000000000..a50292407 --- /dev/null +++ b/spec/javascript/test_valid_fail_repeat_eq_int.js @@ -0,0 +1,7 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +var assert = require('assert'); +var testHelperThrows = require('testHelperThrows'); +var KaitaiStream = require('kaitai-struct/KaitaiStream'); + +testHelperThrows('ValidFailRepeatEqInt', 'src/bcd_user_type_be.bin', KaitaiStream.ValidationNotEqualError); diff --git a/spec/javascript/test_valid_fail_repeat_expr.js b/spec/javascript/test_valid_fail_repeat_expr.js new file mode 100644 index 000000000..76ac13f6d --- /dev/null +++ b/spec/javascript/test_valid_fail_repeat_expr.js @@ -0,0 +1,7 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +var assert = require('assert'); +var testHelperThrows = require('testHelperThrows'); +var KaitaiStream = require('kaitai-struct/KaitaiStream'); + +testHelperThrows('ValidFailRepeatExpr', 'src/bcd_user_type_be.bin', KaitaiStream.ValidationExprError); diff --git a/spec/javascript/test_valid_fail_repeat_inst.js b/spec/javascript/test_valid_fail_repeat_inst.js new file mode 100644 index 000000000..1941b991f --- /dev/null +++ b/spec/javascript/test_valid_fail_repeat_inst.js @@ -0,0 +1,7 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +var assert = require('assert'); +var testHelperThrows = require('testHelperThrows'); +var KaitaiStream = require('kaitai-struct/KaitaiStream'); + +testHelperThrows('ValidFailRepeatInst', 'src/bcd_user_type_be.bin', KaitaiStream.ValidationNotEqualError); diff --git a/spec/javascript/test_valid_fail_repeat_max_int.js b/spec/javascript/test_valid_fail_repeat_max_int.js new file mode 100644 index 000000000..fc0a50402 --- /dev/null +++ b/spec/javascript/test_valid_fail_repeat_max_int.js @@ -0,0 +1,7 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +var assert = require('assert'); +var testHelperThrows = require('testHelperThrows'); +var KaitaiStream = require('kaitai-struct/KaitaiStream'); + +testHelperThrows('ValidFailRepeatMaxInt', 'src/nav_parent_switch.bin', KaitaiStream.ValidationGreaterThanError); diff --git a/spec/javascript/test_valid_fail_repeat_min_int.js b/spec/javascript/test_valid_fail_repeat_min_int.js new file mode 100644 index 000000000..d5f05f67d --- /dev/null +++ b/spec/javascript/test_valid_fail_repeat_min_int.js @@ -0,0 +1,7 @@ +// Autogenerated from KST: please remove this line if doing any edits by hand! + +var assert = require('assert'); +var testHelperThrows = require('testHelperThrows'); +var KaitaiStream = require('kaitai-struct/KaitaiStream'); + +testHelperThrows('ValidFailRepeatMinInt', 'src/process_coerce_bytes.bin', KaitaiStream.ValidationLessThanError); diff --git a/spec/lua/test_valid_fail_repeat_anyof_int.lua b/spec/lua/test_valid_fail_repeat_anyof_int.lua new file mode 100644 index 000000000..ed0ccb044 --- /dev/null +++ b/spec/lua/test_valid_fail_repeat_anyof_int.lua @@ -0,0 +1,11 @@ +-- Autogenerated from KST: please remove this line if doing any edits by hand! + +local luaunit = require("luaunit") + +require("valid_fail_repeat_anyof_int") + +TestValidFailRepeatAnyofInt = {} + +function TestValidFailRepeatAnyofInt:test_valid_fail_repeat_anyof_int() + luaunit.assertErrorMsgMatches(".+: ValidationNotAnyOfError", ValidFailRepeatAnyofInt.from_file, ValidFailRepeatAnyofInt, "src/process_coerce_bytes.bin") +end diff --git a/spec/lua/test_valid_fail_repeat_contents.lua b/spec/lua/test_valid_fail_repeat_contents.lua new file mode 100644 index 000000000..c3f1a3ca3 --- /dev/null +++ b/spec/lua/test_valid_fail_repeat_contents.lua @@ -0,0 +1,11 @@ +-- Autogenerated from KST: please remove this line if doing any edits by hand! + +local luaunit = require("luaunit") + +require("valid_fail_repeat_contents") + +TestValidFailRepeatContents = {} + +function TestValidFailRepeatContents:test_valid_fail_repeat_contents() + luaunit.assertErrorMsgMatches(".+: not equal, expected .*, but got .*", ValidFailRepeatContents.from_file, ValidFailRepeatContents, "src/bcd_user_type_be.bin") +end diff --git a/spec/lua/test_valid_fail_repeat_eq_int.lua b/spec/lua/test_valid_fail_repeat_eq_int.lua new file mode 100644 index 000000000..8e0f95f71 --- /dev/null +++ b/spec/lua/test_valid_fail_repeat_eq_int.lua @@ -0,0 +1,11 @@ +-- Autogenerated from KST: please remove this line if doing any edits by hand! + +local luaunit = require("luaunit") + +require("valid_fail_repeat_eq_int") + +TestValidFailRepeatEqInt = {} + +function TestValidFailRepeatEqInt:test_valid_fail_repeat_eq_int() + luaunit.assertErrorMsgMatches(".+: not equal, expected .*, but got .*", ValidFailRepeatEqInt.from_file, ValidFailRepeatEqInt, "src/bcd_user_type_be.bin") +end diff --git a/spec/lua/test_valid_fail_repeat_expr.lua b/spec/lua/test_valid_fail_repeat_expr.lua new file mode 100644 index 000000000..f8d51839e --- /dev/null +++ b/spec/lua/test_valid_fail_repeat_expr.lua @@ -0,0 +1,11 @@ +-- Autogenerated from KST: please remove this line if doing any edits by hand! + +local luaunit = require("luaunit") + +require("valid_fail_repeat_expr") + +TestValidFailRepeatExpr = {} + +function TestValidFailRepeatExpr:test_valid_fail_repeat_expr() + luaunit.assertErrorMsgMatches(".+: ValidationExprError", ValidFailRepeatExpr.from_file, ValidFailRepeatExpr, "src/bcd_user_type_be.bin") +end diff --git a/spec/lua/test_valid_fail_repeat_inst.lua b/spec/lua/test_valid_fail_repeat_inst.lua new file mode 100644 index 000000000..a87de5790 --- /dev/null +++ b/spec/lua/test_valid_fail_repeat_inst.lua @@ -0,0 +1,11 @@ +-- Autogenerated from KST: please remove this line if doing any edits by hand! + +local luaunit = require("luaunit") + +require("valid_fail_repeat_inst") + +TestValidFailRepeatInst = {} + +function TestValidFailRepeatInst:test_valid_fail_repeat_inst() + luaunit.assertErrorMsgMatches(".+: not equal, expected .*, but got .*", ValidFailRepeatInst.from_file, ValidFailRepeatInst, "src/bcd_user_type_be.bin") +end diff --git a/spec/lua/test_valid_fail_repeat_max_int.lua b/spec/lua/test_valid_fail_repeat_max_int.lua new file mode 100644 index 000000000..75956152f --- /dev/null +++ b/spec/lua/test_valid_fail_repeat_max_int.lua @@ -0,0 +1,11 @@ +-- Autogenerated from KST: please remove this line if doing any edits by hand! + +local luaunit = require("luaunit") + +require("valid_fail_repeat_max_int") + +TestValidFailRepeatMaxInt = {} + +function TestValidFailRepeatMaxInt:test_valid_fail_repeat_max_int() + luaunit.assertErrorMsgMatches(".+: ValidationGreaterThanError", ValidFailRepeatMaxInt.from_file, ValidFailRepeatMaxInt, "src/nav_parent_switch.bin") +end diff --git a/spec/lua/test_valid_fail_repeat_min_int.lua b/spec/lua/test_valid_fail_repeat_min_int.lua new file mode 100644 index 000000000..f87c11799 --- /dev/null +++ b/spec/lua/test_valid_fail_repeat_min_int.lua @@ -0,0 +1,11 @@ +-- Autogenerated from KST: please remove this line if doing any edits by hand! + +local luaunit = require("luaunit") + +require("valid_fail_repeat_min_int") + +TestValidFailRepeatMinInt = {} + +function TestValidFailRepeatMinInt:test_valid_fail_repeat_min_int() + luaunit.assertErrorMsgMatches(".+: ValidationLessThanError", ValidFailRepeatMinInt.from_file, ValidFailRepeatMinInt, "src/process_coerce_bytes.bin") +end diff --git a/spec/php/ValidFailRepeatAnyofIntTest.php b/spec/php/ValidFailRepeatAnyofIntTest.php new file mode 100644 index 000000000..0d56bdee5 --- /dev/null +++ b/spec/php/ValidFailRepeatAnyofIntTest.php @@ -0,0 +1,11 @@ +expectException(\Kaitai\Struct\Error\ValidationNotAnyOfError::class); + $r = ValidFailRepeatAnyofInt::fromFile(self::SRC_DIR_PATH . '/process_coerce_bytes.bin'); + } +} diff --git a/spec/php/ValidFailRepeatContentsTest.php b/spec/php/ValidFailRepeatContentsTest.php new file mode 100644 index 000000000..70221211e --- /dev/null +++ b/spec/php/ValidFailRepeatContentsTest.php @@ -0,0 +1,11 @@ +expectException(\Kaitai\Struct\Error\ValidationNotEqualError::class); + $r = ValidFailRepeatContents::fromFile(self::SRC_DIR_PATH . '/bcd_user_type_be.bin'); + } +} diff --git a/spec/php/ValidFailRepeatEqIntTest.php b/spec/php/ValidFailRepeatEqIntTest.php new file mode 100644 index 000000000..4794f7699 --- /dev/null +++ b/spec/php/ValidFailRepeatEqIntTest.php @@ -0,0 +1,11 @@ +expectException(\Kaitai\Struct\Error\ValidationNotEqualError::class); + $r = ValidFailRepeatEqInt::fromFile(self::SRC_DIR_PATH . '/bcd_user_type_be.bin'); + } +} diff --git a/spec/php/ValidFailRepeatExprTest.php b/spec/php/ValidFailRepeatExprTest.php new file mode 100644 index 000000000..9db46f91b --- /dev/null +++ b/spec/php/ValidFailRepeatExprTest.php @@ -0,0 +1,11 @@ +expectException(\Kaitai\Struct\Error\ValidationExprError::class); + $r = ValidFailRepeatExpr::fromFile(self::SRC_DIR_PATH . '/bcd_user_type_be.bin'); + } +} diff --git a/spec/php/ValidFailRepeatInstTest.php b/spec/php/ValidFailRepeatInstTest.php new file mode 100644 index 000000000..bfe44508a --- /dev/null +++ b/spec/php/ValidFailRepeatInstTest.php @@ -0,0 +1,11 @@ +expectException(\Kaitai\Struct\Error\ValidationNotEqualError::class); + $r = ValidFailRepeatInst::fromFile(self::SRC_DIR_PATH . '/bcd_user_type_be.bin'); + } +} diff --git a/spec/php/ValidFailRepeatMaxIntTest.php b/spec/php/ValidFailRepeatMaxIntTest.php new file mode 100644 index 000000000..df85d37f6 --- /dev/null +++ b/spec/php/ValidFailRepeatMaxIntTest.php @@ -0,0 +1,11 @@ +expectException(\Kaitai\Struct\Error\ValidationGreaterThanError::class); + $r = ValidFailRepeatMaxInt::fromFile(self::SRC_DIR_PATH . '/nav_parent_switch.bin'); + } +} diff --git a/spec/php/ValidFailRepeatMinIntTest.php b/spec/php/ValidFailRepeatMinIntTest.php new file mode 100644 index 000000000..7bcd4343e --- /dev/null +++ b/spec/php/ValidFailRepeatMinIntTest.php @@ -0,0 +1,11 @@ +expectException(\Kaitai\Struct\Error\ValidationLessThanError::class); + $r = ValidFailRepeatMinInt::fromFile(self::SRC_DIR_PATH . '/process_coerce_bytes.bin'); + } +} diff --git a/spec/python/test_valid_fail_repeat_anyof_int.py b/spec/python/test_valid_fail_repeat_anyof_int.py new file mode 100644 index 000000000..fa16dedc7 --- /dev/null +++ b/spec/python/test_valid_fail_repeat_anyof_int.py @@ -0,0 +1,11 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +import unittest +from valid_fail_repeat_anyof_int import ValidFailRepeatAnyofInt +import kaitaistruct + +class TestValidFailRepeatAnyofInt(unittest.TestCase): + def test_valid_fail_repeat_anyof_int(self): + with self.assertRaises(kaitaistruct.ValidationNotAnyOfError): + with ValidFailRepeatAnyofInt.from_file('src/process_coerce_bytes.bin') as r: + pass diff --git a/spec/python/test_valid_fail_repeat_contents.py b/spec/python/test_valid_fail_repeat_contents.py new file mode 100644 index 000000000..e2c057cb1 --- /dev/null +++ b/spec/python/test_valid_fail_repeat_contents.py @@ -0,0 +1,11 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +import unittest +from valid_fail_repeat_contents import ValidFailRepeatContents +import kaitaistruct + +class TestValidFailRepeatContents(unittest.TestCase): + def test_valid_fail_repeat_contents(self): + with self.assertRaises(kaitaistruct.ValidationNotEqualError): + with ValidFailRepeatContents.from_file('src/bcd_user_type_be.bin') as r: + pass diff --git a/spec/python/test_valid_fail_repeat_eq_int.py b/spec/python/test_valid_fail_repeat_eq_int.py new file mode 100644 index 000000000..2576d68aa --- /dev/null +++ b/spec/python/test_valid_fail_repeat_eq_int.py @@ -0,0 +1,11 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +import unittest +from valid_fail_repeat_eq_int import ValidFailRepeatEqInt +import kaitaistruct + +class TestValidFailRepeatEqInt(unittest.TestCase): + def test_valid_fail_repeat_eq_int(self): + with self.assertRaises(kaitaistruct.ValidationNotEqualError): + with ValidFailRepeatEqInt.from_file('src/bcd_user_type_be.bin') as r: + pass diff --git a/spec/python/test_valid_fail_repeat_expr.py b/spec/python/test_valid_fail_repeat_expr.py new file mode 100644 index 000000000..696a076d3 --- /dev/null +++ b/spec/python/test_valid_fail_repeat_expr.py @@ -0,0 +1,11 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +import unittest +from valid_fail_repeat_expr import ValidFailRepeatExpr +import kaitaistruct + +class TestValidFailRepeatExpr(unittest.TestCase): + def test_valid_fail_repeat_expr(self): + with self.assertRaises(kaitaistruct.ValidationExprError): + with ValidFailRepeatExpr.from_file('src/bcd_user_type_be.bin') as r: + pass diff --git a/spec/python/test_valid_fail_repeat_inst.py b/spec/python/test_valid_fail_repeat_inst.py new file mode 100644 index 000000000..6b597b157 --- /dev/null +++ b/spec/python/test_valid_fail_repeat_inst.py @@ -0,0 +1,11 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +import unittest +from valid_fail_repeat_inst import ValidFailRepeatInst +import kaitaistruct + +class TestValidFailRepeatInst(unittest.TestCase): + def test_valid_fail_repeat_inst(self): + with self.assertRaises(kaitaistruct.ValidationNotEqualError): + with ValidFailRepeatInst.from_file('src/bcd_user_type_be.bin') as r: + pass diff --git a/spec/python/test_valid_fail_repeat_max_int.py b/spec/python/test_valid_fail_repeat_max_int.py new file mode 100644 index 000000000..fd9e0bf75 --- /dev/null +++ b/spec/python/test_valid_fail_repeat_max_int.py @@ -0,0 +1,11 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +import unittest +from valid_fail_repeat_max_int import ValidFailRepeatMaxInt +import kaitaistruct + +class TestValidFailRepeatMaxInt(unittest.TestCase): + def test_valid_fail_repeat_max_int(self): + with self.assertRaises(kaitaistruct.ValidationGreaterThanError): + with ValidFailRepeatMaxInt.from_file('src/nav_parent_switch.bin') as r: + pass diff --git a/spec/python/test_valid_fail_repeat_min_int.py b/spec/python/test_valid_fail_repeat_min_int.py new file mode 100644 index 000000000..ec4ec8356 --- /dev/null +++ b/spec/python/test_valid_fail_repeat_min_int.py @@ -0,0 +1,11 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +import unittest +from valid_fail_repeat_min_int import ValidFailRepeatMinInt +import kaitaistruct + +class TestValidFailRepeatMinInt(unittest.TestCase): + def test_valid_fail_repeat_min_int(self): + with self.assertRaises(kaitaistruct.ValidationLessThanError): + with ValidFailRepeatMinInt.from_file('src/process_coerce_bytes.bin') as r: + pass diff --git a/spec/ruby/valid_fail_repeat_anyof_int_spec.rb b/spec/ruby/valid_fail_repeat_anyof_int_spec.rb new file mode 100644 index 000000000..6bf597996 --- /dev/null +++ b/spec/ruby/valid_fail_repeat_anyof_int_spec.rb @@ -0,0 +1,10 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +RSpec.describe 'ValidFailRepeatAnyofInt' do + it 'parses test properly' do + require 'valid_fail_repeat_anyof_int' + expect { + r = ValidFailRepeatAnyofInt.from_file('src/process_coerce_bytes.bin') + }.to raise_error(Kaitai::Struct::ValidationNotAnyOfError) + end +end diff --git a/spec/ruby/valid_fail_repeat_contents_spec.rb b/spec/ruby/valid_fail_repeat_contents_spec.rb new file mode 100644 index 000000000..4c2c8fb87 --- /dev/null +++ b/spec/ruby/valid_fail_repeat_contents_spec.rb @@ -0,0 +1,10 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +RSpec.describe 'ValidFailRepeatContents' do + it 'parses test properly' do + require 'valid_fail_repeat_contents' + expect { + r = ValidFailRepeatContents.from_file('src/bcd_user_type_be.bin') + }.to raise_error(Kaitai::Struct::ValidationNotEqualError) + end +end diff --git a/spec/ruby/valid_fail_repeat_eq_int_spec.rb b/spec/ruby/valid_fail_repeat_eq_int_spec.rb new file mode 100644 index 000000000..d15f88658 --- /dev/null +++ b/spec/ruby/valid_fail_repeat_eq_int_spec.rb @@ -0,0 +1,10 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +RSpec.describe 'ValidFailRepeatEqInt' do + it 'parses test properly' do + require 'valid_fail_repeat_eq_int' + expect { + r = ValidFailRepeatEqInt.from_file('src/bcd_user_type_be.bin') + }.to raise_error(Kaitai::Struct::ValidationNotEqualError) + end +end diff --git a/spec/ruby/valid_fail_repeat_expr_spec.rb b/spec/ruby/valid_fail_repeat_expr_spec.rb new file mode 100644 index 000000000..0453f219a --- /dev/null +++ b/spec/ruby/valid_fail_repeat_expr_spec.rb @@ -0,0 +1,10 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +RSpec.describe 'ValidFailRepeatExpr' do + it 'parses test properly' do + require 'valid_fail_repeat_expr' + expect { + r = ValidFailRepeatExpr.from_file('src/bcd_user_type_be.bin') + }.to raise_error(Kaitai::Struct::ValidationExprError) + end +end diff --git a/spec/ruby/valid_fail_repeat_inst_spec.rb b/spec/ruby/valid_fail_repeat_inst_spec.rb new file mode 100644 index 000000000..ef206abd7 --- /dev/null +++ b/spec/ruby/valid_fail_repeat_inst_spec.rb @@ -0,0 +1,10 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +RSpec.describe 'ValidFailRepeatInst' do + it 'parses test properly' do + require 'valid_fail_repeat_inst' + expect { + r = ValidFailRepeatInst.from_file('src/bcd_user_type_be.bin') + }.to raise_error(Kaitai::Struct::ValidationNotEqualError) + end +end diff --git a/spec/ruby/valid_fail_repeat_max_int_spec.rb b/spec/ruby/valid_fail_repeat_max_int_spec.rb new file mode 100644 index 000000000..e4494409f --- /dev/null +++ b/spec/ruby/valid_fail_repeat_max_int_spec.rb @@ -0,0 +1,10 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +RSpec.describe 'ValidFailRepeatMaxInt' do + it 'parses test properly' do + require 'valid_fail_repeat_max_int' + expect { + r = ValidFailRepeatMaxInt.from_file('src/nav_parent_switch.bin') + }.to raise_error(Kaitai::Struct::ValidationGreaterThanError) + end +end diff --git a/spec/ruby/valid_fail_repeat_min_int_spec.rb b/spec/ruby/valid_fail_repeat_min_int_spec.rb new file mode 100644 index 000000000..2805113ed --- /dev/null +++ b/spec/ruby/valid_fail_repeat_min_int_spec.rb @@ -0,0 +1,10 @@ +# Autogenerated from KST: please remove this line if doing any edits by hand! + +RSpec.describe 'ValidFailRepeatMinInt' do + it 'parses test properly' do + require 'valid_fail_repeat_min_int' + expect { + r = ValidFailRepeatMinInt.from_file('src/process_coerce_bytes.bin') + }.to raise_error(Kaitai::Struct::ValidationLessThanError) + end +end