From b288b6b69799321fc53dddb0dcd3f79a2c9bdbe0 Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Sat, 28 Sep 2024 18:33:08 +0200 Subject: [PATCH] JavaScript: regen specs with enum literals from KST Using KSC at https://github.com/kaitai-io/kaitai_struct_compiler/tree/8d913def37a571bf8dd817f4f0d0f3bab3751f3a --- helpers/javascript/testHelper.js | 6 +++--- spec/javascript/test_bits_enum.js | 8 ++++---- spec/javascript/test_combine_enum.js | 8 ++++---- spec/javascript/test_enum_0.js | 6 +++--- spec/javascript/test_enum_1.js | 6 +++--- spec/javascript/test_enum_deep.js | 6 +++--- spec/javascript/test_enum_fancy.js | 6 +++--- spec/javascript/test_enum_if.js | 8 ++++---- spec/javascript/test_enum_import_literals.js | 6 +++--- spec/javascript/test_enum_import_seq.js | 10 +++++----- spec/javascript/test_enum_int_range_s.js | 8 ++++---- spec/javascript/test_enum_int_range_u.js | 6 +++--- spec/javascript/test_enum_invalid.js | 4 ++-- spec/javascript/test_enum_long_range_s.js | 16 ++++++++-------- spec/javascript/test_enum_long_range_u.js | 10 +++++----- spec/javascript/test_enum_negative.js | 6 +++--- spec/javascript/test_enum_of_value_inst.js | 10 +++++----- spec/javascript/test_enum_to_i.js | 6 +++--- spec/javascript/test_enum_to_i_class_border_1.js | 6 +++--- spec/javascript/test_enum_to_i_invalid.js | 4 ++-- spec/javascript/test_expr_bits.js | 6 +++--- spec/javascript/test_expr_enum.js | 8 ++++---- .../test_imports_params_def_enum_imported.js | 14 +++++++------- spec/javascript/test_params_enum.js | 4 ++-- spec/javascript/test_switch_manual_enum.js | 10 +++++----- spec/javascript/test_ts_packet_header.js | 4 ++-- 26 files changed, 96 insertions(+), 96 deletions(-) diff --git a/helpers/javascript/testHelper.js b/helpers/javascript/testHelper.js index e56a3573c..359d89799 100644 --- a/helpers/javascript/testHelper.js +++ b/helpers/javascript/testHelper.js @@ -4,16 +4,16 @@ function testHelper(className, fileName, testFunc) { describe(className, function() { it('parses test properly', function(done) { - var parser = require(className)[className]; + var parser_ = require(className); fs.readFile(fileName, function(err, buf) { if (err) { done(err); return; } var st = new KaitaiStream(buf); - var r = new parser(st); + var r = new parser_[className](st); try { - testFunc(r, parser); + testFunc(r, parser_); } catch (e) { done(e); return; diff --git a/spec/javascript/test_bits_enum.js b/spec/javascript/test_bits_enum.js index bccc1ed11..6cd089716 100644 --- a/spec/javascript/test_bits_enum.js +++ b/spec/javascript/test_bits_enum.js @@ -3,8 +3,8 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('BitsEnum', 'src/fixed_struct.bin', function(r, BitsEnum) { - assert.strictEqual(r.one, BitsEnum.Animal.PLATYPUS); - assert.strictEqual(r.two, BitsEnum.Animal.HORSE); - assert.strictEqual(r.three, BitsEnum.Animal.CAT); +testHelper('BitsEnum', 'src/fixed_struct.bin', function(r, BitsEnum_) { + assert.strictEqual(r.one, BitsEnum_.BitsEnum.Animal.PLATYPUS); + assert.strictEqual(r.two, BitsEnum_.BitsEnum.Animal.HORSE); + assert.strictEqual(r.three, BitsEnum_.BitsEnum.Animal.CAT); }); diff --git a/spec/javascript/test_combine_enum.js b/spec/javascript/test_combine_enum.js index d3b16f512..d32fd007a 100644 --- a/spec/javascript/test_combine_enum.js +++ b/spec/javascript/test_combine_enum.js @@ -3,8 +3,8 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('CombineEnum', 'src/enum_0.bin', function(r, CombineEnum) { - assert.strictEqual(r.enumU4, CombineEnum.Animal.PIG); - assert.strictEqual(r.enumU2, CombineEnum.Animal.HORSE); - assert.strictEqual(r.enumU4U2, CombineEnum.Animal.HORSE); +testHelper('CombineEnum', 'src/enum_0.bin', function(r, CombineEnum_) { + assert.strictEqual(r.enumU4, CombineEnum_.CombineEnum.Animal.PIG); + assert.strictEqual(r.enumU2, CombineEnum_.CombineEnum.Animal.HORSE); + assert.strictEqual(r.enumU4U2, CombineEnum_.CombineEnum.Animal.HORSE); }); diff --git a/spec/javascript/test_enum_0.js b/spec/javascript/test_enum_0.js index f3099395d..044b67e88 100644 --- a/spec/javascript/test_enum_0.js +++ b/spec/javascript/test_enum_0.js @@ -3,7 +3,7 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('Enum0', 'src/enum_0.bin', function(r, Enum0) { - assert.strictEqual(r.pet1, Enum0.Animal.CAT); - assert.strictEqual(r.pet2, Enum0.Animal.CHICKEN); +testHelper('Enum0', 'src/enum_0.bin', function(r, Enum0_) { + assert.strictEqual(r.pet1, Enum0_.Enum0.Animal.CAT); + assert.strictEqual(r.pet2, Enum0_.Enum0.Animal.CHICKEN); }); diff --git a/spec/javascript/test_enum_1.js b/spec/javascript/test_enum_1.js index 53bb12a4c..8511faad4 100644 --- a/spec/javascript/test_enum_1.js +++ b/spec/javascript/test_enum_1.js @@ -3,7 +3,7 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('Enum1', 'src/enum_0.bin', function(r, Enum1) { - assert.strictEqual(r.main.submain.pet1, Enum1.MainObj.Animal.CAT); - assert.strictEqual(r.main.submain.pet2, Enum1.MainObj.Animal.CHICKEN); +testHelper('Enum1', 'src/enum_0.bin', function(r, Enum1_) { + assert.strictEqual(r.main.submain.pet1, Enum1_.Enum1.MainObj.Animal.CAT); + assert.strictEqual(r.main.submain.pet2, Enum1_.Enum1.MainObj.Animal.CHICKEN); }); diff --git a/spec/javascript/test_enum_deep.js b/spec/javascript/test_enum_deep.js index 9ed70d5f0..40833dec4 100644 --- a/spec/javascript/test_enum_deep.js +++ b/spec/javascript/test_enum_deep.js @@ -3,7 +3,7 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumDeep', 'src/enum_0.bin', function(r, EnumDeep) { - assert.strictEqual(r.pet1, EnumDeep.Container1.Animal.CAT); - assert.strictEqual(r.pet2, EnumDeep.Container1.Container2.Animal.HARE); +testHelper('EnumDeep', 'src/enum_0.bin', function(r, EnumDeep_) { + assert.strictEqual(r.pet1, EnumDeep_.EnumDeep.Container1.Animal.CAT); + assert.strictEqual(r.pet2, EnumDeep_.EnumDeep.Container1.Container2.Animal.HARE); }); diff --git a/spec/javascript/test_enum_fancy.js b/spec/javascript/test_enum_fancy.js index 107c05d4d..e7db8c34a 100644 --- a/spec/javascript/test_enum_fancy.js +++ b/spec/javascript/test_enum_fancy.js @@ -3,7 +3,7 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumFancy', 'src/enum_0.bin', function(r, EnumFancy) { - assert.strictEqual(r.pet1, EnumFancy.Animal.CAT); - assert.strictEqual(r.pet2, EnumFancy.Animal.CHICKEN); +testHelper('EnumFancy', 'src/enum_0.bin', function(r, EnumFancy_) { + assert.strictEqual(r.pet1, EnumFancy_.EnumFancy.Animal.CAT); + assert.strictEqual(r.pet2, EnumFancy_.EnumFancy.Animal.CHICKEN); }); diff --git a/spec/javascript/test_enum_if.js b/spec/javascript/test_enum_if.js index b2a9ce35d..fd8b53656 100644 --- a/spec/javascript/test_enum_if.js +++ b/spec/javascript/test_enum_if.js @@ -3,12 +3,12 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumIf', 'src/if_struct.bin', function(r, EnumIf) { - assert.strictEqual(r.op1.opcode, EnumIf.Opcodes.A_STRING); +testHelper('EnumIf', 'src/if_struct.bin', function(r, EnumIf_) { + assert.strictEqual(r.op1.opcode, EnumIf_.EnumIf.Opcodes.A_STRING); assert.strictEqual(r.op1.argStr.str, "foo"); - assert.strictEqual(r.op2.opcode, EnumIf.Opcodes.A_TUPLE); + assert.strictEqual(r.op2.opcode, EnumIf_.EnumIf.Opcodes.A_TUPLE); assert.strictEqual(r.op2.argTuple.num1, 66); assert.strictEqual(r.op2.argTuple.num2, 67); - assert.strictEqual(r.op3.opcode, EnumIf.Opcodes.A_STRING); + assert.strictEqual(r.op3.opcode, EnumIf_.EnumIf.Opcodes.A_STRING); assert.strictEqual(r.op3.argStr.str, "bar"); }); diff --git a/spec/javascript/test_enum_import_literals.js b/spec/javascript/test_enum_import_literals.js index 84f2d4d8e..5ef864ce2 100644 --- a/spec/javascript/test_enum_import_literals.js +++ b/spec/javascript/test_enum_import_literals.js @@ -3,9 +3,9 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumImportLiterals', 'src/enum_0.bin', function(r, EnumImportLiterals) { - var EnumDeep = require('EnumDeep').EnumDeep; +testHelper('EnumImportLiterals', 'src/enum_0.bin', function(r, EnumImportLiterals_) { + var EnumDeep_ = require('EnumDeep'); assert.strictEqual(r.pet1ToI, 7); assert.strictEqual(r.pet1Eq, true); - assert.strictEqual(r.pet2, EnumDeep.Container1.Container2.Animal.HARE); + assert.strictEqual(r.pet2, EnumDeep_.EnumDeep.Container1.Container2.Animal.HARE); }); diff --git a/spec/javascript/test_enum_import_seq.js b/spec/javascript/test_enum_import_seq.js index 35f16320f..27dc6b585 100644 --- a/spec/javascript/test_enum_import_seq.js +++ b/spec/javascript/test_enum_import_seq.js @@ -3,9 +3,9 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumImportSeq', 'src/enum_0.bin', function(r, EnumImportSeq) { - var Enum0 = require('Enum0').Enum0; - var EnumDeep = require('EnumDeep').EnumDeep; - assert.strictEqual(r.pet1, Enum0.Animal.CAT); - assert.strictEqual(r.pet2, EnumDeep.Container1.Container2.Animal.HARE); +testHelper('EnumImportSeq', 'src/enum_0.bin', function(r, EnumImportSeq_) { + var Enum0_ = require('Enum0'); + var EnumDeep_ = require('EnumDeep'); + assert.strictEqual(r.pet1, Enum0_.Enum0.Animal.CAT); + assert.strictEqual(r.pet2, EnumDeep_.EnumDeep.Container1.Container2.Animal.HARE); }); diff --git a/spec/javascript/test_enum_int_range_s.js b/spec/javascript/test_enum_int_range_s.js index 4618f05bc..0c8c3e52b 100644 --- a/spec/javascript/test_enum_int_range_s.js +++ b/spec/javascript/test_enum_int_range_s.js @@ -3,8 +3,8 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumIntRangeS', 'src/enum_int_range_s.bin', function(r, EnumIntRangeS) { - assert.strictEqual(r.f1, EnumIntRangeS.Constants.INT_MIN); - assert.strictEqual(r.f2, EnumIntRangeS.Constants.ZERO); - assert.strictEqual(r.f3, EnumIntRangeS.Constants.INT_MAX); +testHelper('EnumIntRangeS', 'src/enum_int_range_s.bin', function(r, EnumIntRangeS_) { + assert.strictEqual(r.f1, EnumIntRangeS_.EnumIntRangeS.Constants.INT_MIN); + assert.strictEqual(r.f2, EnumIntRangeS_.EnumIntRangeS.Constants.ZERO); + assert.strictEqual(r.f3, EnumIntRangeS_.EnumIntRangeS.Constants.INT_MAX); }); diff --git a/spec/javascript/test_enum_int_range_u.js b/spec/javascript/test_enum_int_range_u.js index 42648e444..067bfb3cc 100644 --- a/spec/javascript/test_enum_int_range_u.js +++ b/spec/javascript/test_enum_int_range_u.js @@ -3,7 +3,7 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumIntRangeU', 'src/enum_int_range_u.bin', function(r, EnumIntRangeU) { - assert.strictEqual(r.f1, EnumIntRangeU.Constants.ZERO); - assert.strictEqual(r.f2, EnumIntRangeU.Constants.INT_MAX); +testHelper('EnumIntRangeU', 'src/enum_int_range_u.bin', function(r, EnumIntRangeU_) { + assert.strictEqual(r.f1, EnumIntRangeU_.EnumIntRangeU.Constants.ZERO); + assert.strictEqual(r.f2, EnumIntRangeU_.EnumIntRangeU.Constants.INT_MAX); }); diff --git a/spec/javascript/test_enum_invalid.js b/spec/javascript/test_enum_invalid.js index a7d48250a..84ea90ecb 100644 --- a/spec/javascript/test_enum_invalid.js +++ b/spec/javascript/test_enum_invalid.js @@ -3,7 +3,7 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumInvalid', 'src/term_strz.bin', function(r, EnumInvalid) { - assert.strictEqual(r.pet1, EnumInvalid.Animal.DOG); +testHelper('EnumInvalid', 'src/term_strz.bin', function(r, EnumInvalid_) { + assert.strictEqual(r.pet1, EnumInvalid_.EnumInvalid.Animal.DOG); assert.strictEqual(r.pet2, 111); }); diff --git a/spec/javascript/test_enum_long_range_s.js b/spec/javascript/test_enum_long_range_s.js index 2e0559393..ad051f847 100644 --- a/spec/javascript/test_enum_long_range_s.js +++ b/spec/javascript/test_enum_long_range_s.js @@ -3,12 +3,12 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumLongRangeS', 'src/enum_long_range_s.bin', function(r, EnumLongRangeS) { - assert.strictEqual(r.f1, EnumLongRangeS.Constants.LONG_MIN); - assert.strictEqual(r.f2, EnumLongRangeS.Constants.INT_BELOW_MIN); - assert.strictEqual(r.f3, EnumLongRangeS.Constants.INT_MIN); - assert.strictEqual(r.f4, EnumLongRangeS.Constants.ZERO); - assert.strictEqual(r.f5, EnumLongRangeS.Constants.INT_MAX); - assert.strictEqual(r.f6, EnumLongRangeS.Constants.INT_OVER_MAX); - assert.strictEqual(r.f7, EnumLongRangeS.Constants.LONG_MAX); +testHelper('EnumLongRangeS', 'src/enum_long_range_s.bin', function(r, EnumLongRangeS_) { + assert.strictEqual(r.f1, EnumLongRangeS_.EnumLongRangeS.Constants.LONG_MIN); + assert.strictEqual(r.f2, EnumLongRangeS_.EnumLongRangeS.Constants.INT_BELOW_MIN); + assert.strictEqual(r.f3, EnumLongRangeS_.EnumLongRangeS.Constants.INT_MIN); + assert.strictEqual(r.f4, EnumLongRangeS_.EnumLongRangeS.Constants.ZERO); + assert.strictEqual(r.f5, EnumLongRangeS_.EnumLongRangeS.Constants.INT_MAX); + assert.strictEqual(r.f6, EnumLongRangeS_.EnumLongRangeS.Constants.INT_OVER_MAX); + assert.strictEqual(r.f7, EnumLongRangeS_.EnumLongRangeS.Constants.LONG_MAX); }); diff --git a/spec/javascript/test_enum_long_range_u.js b/spec/javascript/test_enum_long_range_u.js index bfee7ee49..ef30a97a4 100644 --- a/spec/javascript/test_enum_long_range_u.js +++ b/spec/javascript/test_enum_long_range_u.js @@ -3,9 +3,9 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumLongRangeU', 'src/enum_long_range_u.bin', function(r, EnumLongRangeU) { - assert.strictEqual(r.f1, EnumLongRangeU.Constants.ZERO); - assert.strictEqual(r.f2, EnumLongRangeU.Constants.INT_MAX); - assert.strictEqual(r.f3, EnumLongRangeU.Constants.INT_OVER_MAX); - assert.strictEqual(r.f4, EnumLongRangeU.Constants.LONG_MAX); +testHelper('EnumLongRangeU', 'src/enum_long_range_u.bin', function(r, EnumLongRangeU_) { + assert.strictEqual(r.f1, EnumLongRangeU_.EnumLongRangeU.Constants.ZERO); + assert.strictEqual(r.f2, EnumLongRangeU_.EnumLongRangeU.Constants.INT_MAX); + assert.strictEqual(r.f3, EnumLongRangeU_.EnumLongRangeU.Constants.INT_OVER_MAX); + assert.strictEqual(r.f4, EnumLongRangeU_.EnumLongRangeU.Constants.LONG_MAX); }); diff --git a/spec/javascript/test_enum_negative.js b/spec/javascript/test_enum_negative.js index 26f73d3c3..3434e4ad0 100644 --- a/spec/javascript/test_enum_negative.js +++ b/spec/javascript/test_enum_negative.js @@ -3,7 +3,7 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumNegative', 'src/enum_negative.bin', function(r, EnumNegative) { - assert.strictEqual(r.f1, EnumNegative.Constants.NEGATIVE_ONE); - assert.strictEqual(r.f2, EnumNegative.Constants.POSITIVE_ONE); +testHelper('EnumNegative', 'src/enum_negative.bin', function(r, EnumNegative_) { + assert.strictEqual(r.f1, EnumNegative_.EnumNegative.Constants.NEGATIVE_ONE); + assert.strictEqual(r.f2, EnumNegative_.EnumNegative.Constants.POSITIVE_ONE); }); diff --git a/spec/javascript/test_enum_of_value_inst.js b/spec/javascript/test_enum_of_value_inst.js index 989809d8c..f7de98571 100644 --- a/spec/javascript/test_enum_of_value_inst.js +++ b/spec/javascript/test_enum_of_value_inst.js @@ -3,9 +3,9 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumOfValueInst', 'src/enum_0.bin', function(r, EnumOfValueInst) { - assert.strictEqual(r.pet1, EnumOfValueInst.Animal.CAT); - assert.strictEqual(r.pet2, EnumOfValueInst.Animal.CHICKEN); - assert.strictEqual(r.pet3, EnumOfValueInst.Animal.DOG); - assert.strictEqual(r.pet4, EnumOfValueInst.Animal.DOG); +testHelper('EnumOfValueInst', 'src/enum_0.bin', function(r, EnumOfValueInst_) { + assert.strictEqual(r.pet1, EnumOfValueInst_.EnumOfValueInst.Animal.CAT); + assert.strictEqual(r.pet2, EnumOfValueInst_.EnumOfValueInst.Animal.CHICKEN); + assert.strictEqual(r.pet3, EnumOfValueInst_.EnumOfValueInst.Animal.DOG); + assert.strictEqual(r.pet4, EnumOfValueInst_.EnumOfValueInst.Animal.DOG); }); diff --git a/spec/javascript/test_enum_to_i.js b/spec/javascript/test_enum_to_i.js index 5a060e922..30ef86da4 100644 --- a/spec/javascript/test_enum_to_i.js +++ b/spec/javascript/test_enum_to_i.js @@ -3,9 +3,9 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumToI', 'src/enum_0.bin', function(r, EnumToI) { - assert.strictEqual(r.pet1, EnumToI.Animal.CAT); - assert.strictEqual(r.pet2, EnumToI.Animal.CHICKEN); +testHelper('EnumToI', 'src/enum_0.bin', function(r, EnumToI_) { + assert.strictEqual(r.pet1, EnumToI_.EnumToI.Animal.CAT); + assert.strictEqual(r.pet2, EnumToI_.EnumToI.Animal.CHICKEN); assert.strictEqual(r.pet1I, 7); assert.strictEqual(r.pet1IToS, "7"); assert.strictEqual(r.pet1Mod, 32775); diff --git a/spec/javascript/test_enum_to_i_class_border_1.js b/spec/javascript/test_enum_to_i_class_border_1.js index 0091ba058..2699ec074 100644 --- a/spec/javascript/test_enum_to_i_class_border_1.js +++ b/spec/javascript/test_enum_to_i_class_border_1.js @@ -3,8 +3,8 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumToIClassBorder1', 'src/enum_0.bin', function(r, EnumToIClassBorder1) { - assert.strictEqual(r.pet1, EnumToIClassBorder1.Animal.CAT); - assert.strictEqual(r.pet2, EnumToIClassBorder1.Animal.CHICKEN); +testHelper('EnumToIClassBorder1', 'src/enum_0.bin', function(r, EnumToIClassBorder1_) { + assert.strictEqual(r.pet1, EnumToIClassBorder1_.EnumToIClassBorder1.Animal.CAT); + assert.strictEqual(r.pet2, EnumToIClassBorder1_.EnumToIClassBorder1.Animal.CHICKEN); assert.strictEqual(r.checker.isDog, true); }); diff --git a/spec/javascript/test_enum_to_i_invalid.js b/spec/javascript/test_enum_to_i_invalid.js index a937dee7a..ea8047626 100644 --- a/spec/javascript/test_enum_to_i_invalid.js +++ b/spec/javascript/test_enum_to_i_invalid.js @@ -3,8 +3,8 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('EnumToIInvalid', 'src/term_strz.bin', function(r, EnumToIInvalid) { - assert.strictEqual(r.pet1, EnumToIInvalid.Animal.DOG); +testHelper('EnumToIInvalid', 'src/term_strz.bin', function(r, EnumToIInvalid_) { + assert.strictEqual(r.pet1, EnumToIInvalid_.EnumToIInvalid.Animal.DOG); assert.strictEqual(r.pet2, 111); assert.strictEqual(r.pet2I, 111); assert.strictEqual(r.pet2IToS, "111"); diff --git a/spec/javascript/test_expr_bits.js b/spec/javascript/test_expr_bits.js index 92c90c737..47091ced9 100644 --- a/spec/javascript/test_expr_bits.js +++ b/spec/javascript/test_expr_bits.js @@ -4,15 +4,15 @@ var assert = require('assert'); var testHelper = require('testHelper'); var hexString = require('hexString'); -testHelper('ExprBits', 'src/switch_opcodes.bin', function(r, ExprBits) { +testHelper('ExprBits', 'src/switch_opcodes.bin', function(r, ExprBits_) { assert.strictEqual(r.a, 2); - assert.strictEqual(r.enumSeq, ExprBits.Items.FOO); + assert.strictEqual(r.enumSeq, ExprBits_.ExprBits.Items.FOO); assert.strictEqual(hexString(r.byteSize), hexString([102, 111])); assert.strictEqual(r.repeatExpr.length, 2); assert.strictEqual(r.repeatExpr[0], 111); assert.strictEqual(r.repeatExpr[1], 98); assert.strictEqual(r.switchOnType, 97); assert.strictEqual(r.switchOnEndian.foo, 29184); - assert.strictEqual(r.enumInst, ExprBits.Items.BAR); + assert.strictEqual(r.enumInst, ExprBits_.ExprBits.Items.BAR); assert.strictEqual(r.instPos, 111); }); diff --git a/spec/javascript/test_expr_enum.js b/spec/javascript/test_expr_enum.js index 82f2535c2..869528849 100644 --- a/spec/javascript/test_expr_enum.js +++ b/spec/javascript/test_expr_enum.js @@ -3,8 +3,8 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('ExprEnum', 'src/term_strz.bin', function(r, ExprEnum) { - assert.strictEqual(r.constDog, ExprEnum.Animal.DOG); - assert.strictEqual(r.derivedBoom, ExprEnum.Animal.BOOM); - assert.strictEqual(r.derivedDog, ExprEnum.Animal.DOG); +testHelper('ExprEnum', 'src/term_strz.bin', function(r, ExprEnum_) { + assert.strictEqual(r.constDog, ExprEnum_.ExprEnum.Animal.DOG); + assert.strictEqual(r.derivedBoom, ExprEnum_.ExprEnum.Animal.BOOM); + assert.strictEqual(r.derivedDog, ExprEnum_.ExprEnum.Animal.DOG); }); diff --git a/spec/javascript/test_imports_params_def_enum_imported.js b/spec/javascript/test_imports_params_def_enum_imported.js index 6e30adb3d..ae80191eb 100644 --- a/spec/javascript/test_imports_params_def_enum_imported.js +++ b/spec/javascript/test_imports_params_def_enum_imported.js @@ -3,11 +3,11 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('ImportsParamsDefEnumImported', 'src/enum_0.bin', function(r, ImportsParamsDefEnumImported) { - var Enum0 = require('Enum0').Enum0; - var EnumDeep = require('EnumDeep').EnumDeep; - assert.strictEqual(r.one.pet1, Enum0.Animal.CAT); - assert.strictEqual(r.one.pet2, EnumDeep.Container1.Container2.Animal.HARE); - assert.strictEqual(r.two.pet1Param, Enum0.Animal.CAT); - assert.strictEqual(r.two.pet2Param, EnumDeep.Container1.Container2.Animal.HARE); +testHelper('ImportsParamsDefEnumImported', 'src/enum_0.bin', function(r, ImportsParamsDefEnumImported_) { + var Enum0_ = require('Enum0'); + var EnumDeep_ = require('EnumDeep'); + assert.strictEqual(r.one.pet1, Enum0_.Enum0.Animal.CAT); + assert.strictEqual(r.one.pet2, EnumDeep_.EnumDeep.Container1.Container2.Animal.HARE); + assert.strictEqual(r.two.pet1Param, Enum0_.Enum0.Animal.CAT); + assert.strictEqual(r.two.pet2Param, EnumDeep_.EnumDeep.Container1.Container2.Animal.HARE); }); diff --git a/spec/javascript/test_params_enum.js b/spec/javascript/test_params_enum.js index 0fb7d7280..7179a629d 100644 --- a/spec/javascript/test_params_enum.js +++ b/spec/javascript/test_params_enum.js @@ -3,7 +3,7 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('ParamsEnum', 'src/enum_0.bin', function(r, ParamsEnum) { - assert.strictEqual(r.one, ParamsEnum.Animal.CAT); +testHelper('ParamsEnum', 'src/enum_0.bin', function(r, ParamsEnum_) { + assert.strictEqual(r.one, ParamsEnum_.ParamsEnum.Animal.CAT); assert.strictEqual(r.invokeWithParam.isCat, true); }); diff --git a/spec/javascript/test_switch_manual_enum.js b/spec/javascript/test_switch_manual_enum.js index 400d43be3..87359cee0 100644 --- a/spec/javascript/test_switch_manual_enum.js +++ b/spec/javascript/test_switch_manual_enum.js @@ -3,14 +3,14 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('SwitchManualEnum', 'src/switch_opcodes.bin', function(r, SwitchManualEnum) { +testHelper('SwitchManualEnum', 'src/switch_opcodes.bin', function(r, SwitchManualEnum_) { assert.strictEqual(r.opcodes.length, 4); - assert.strictEqual(r.opcodes[0].code, SwitchManualEnum.Opcode.CodeEnum.STRVAL); + assert.strictEqual(r.opcodes[0].code, SwitchManualEnum_.SwitchManualEnum.Opcode.CodeEnum.STRVAL); assert.strictEqual(r.opcodes[0].body.value, "foobar"); - assert.strictEqual(r.opcodes[1].code, SwitchManualEnum.Opcode.CodeEnum.INTVAL); + assert.strictEqual(r.opcodes[1].code, SwitchManualEnum_.SwitchManualEnum.Opcode.CodeEnum.INTVAL); assert.strictEqual(r.opcodes[1].body.value, 66); - assert.strictEqual(r.opcodes[2].code, SwitchManualEnum.Opcode.CodeEnum.INTVAL); + assert.strictEqual(r.opcodes[2].code, SwitchManualEnum_.SwitchManualEnum.Opcode.CodeEnum.INTVAL); assert.strictEqual(r.opcodes[2].body.value, 55); - assert.strictEqual(r.opcodes[3].code, SwitchManualEnum.Opcode.CodeEnum.STRVAL); + assert.strictEqual(r.opcodes[3].code, SwitchManualEnum_.SwitchManualEnum.Opcode.CodeEnum.STRVAL); assert.strictEqual(r.opcodes[3].body.value, ""); }); diff --git a/spec/javascript/test_ts_packet_header.js b/spec/javascript/test_ts_packet_header.js index 4bc112b78..24403f82a 100644 --- a/spec/javascript/test_ts_packet_header.js +++ b/spec/javascript/test_ts_packet_header.js @@ -3,12 +3,12 @@ var assert = require('assert'); var testHelper = require('testHelper'); -testHelper('TsPacketHeader', 'src/ts_packet.bin', function(r, TsPacketHeader) { +testHelper('TsPacketHeader', 'src/ts_packet.bin', function(r, TsPacketHeader_) { assert.strictEqual(r.syncByte, 71); assert.strictEqual(r.transportErrorIndicator, false); assert.strictEqual(r.payloadUnitStartIndicator, false); assert.strictEqual(r.transportPriority, true); assert.strictEqual(r.pid, 33); assert.strictEqual(r.transportScramblingControl, 0); - assert.strictEqual(r.adaptationFieldControl, TsPacketHeader.AdaptationFieldControlEnum.PAYLOAD_ONLY); + assert.strictEqual(r.adaptationFieldControl, TsPacketHeader_.TsPacketHeader.AdaptationFieldControlEnum.PAYLOAD_ONLY); });