From e79f3a06d218860ac8f6d767df121fa8da006fd2 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Mon, 7 Jan 2019 10:49:55 -0600 Subject: TAO_IDL: make recent changes work with older MSVC --- TAO/TAO_IDL/ast/ast_typedef.cpp | 5 ++++- TAO/TAO_IDL/include/idl_global.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/TAO/TAO_IDL/ast/ast_typedef.cpp b/TAO/TAO_IDL/ast/ast_typedef.cpp index 760bf9b55c7..38fc2080164 100644 --- a/TAO/TAO_IDL/ast/ast_typedef.cpp +++ b/TAO/TAO_IDL/ast/ast_typedef.cpp @@ -74,6 +74,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ace/Log_Msg.h" +// FUZZ: disable check_for_streams_include +#include "ace/streams.h" + AST_Decl::NodeType const AST_Typedef::NT = AST_Decl::NT_typedef; @@ -153,7 +156,7 @@ AST_Typedef::owns_base_type (bool val) // Dump this AST_Typedef node to the ostream o. void -AST_Typedef::dump (ACE_OSTREAM_TYPE&o) +AST_Typedef::dump (ACE_OSTREAM_TYPE &o) { this->dump_i (o, "typedef "); o << *ref_type_; diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index b5838e0ff58..dae0328872e 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -74,6 +74,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_expression.h" #include "ast_predefined_type.h" +#include "utl_identifier.h" #include "utl_stack.h" #include "fe_utils.h" #include "idl_version.h" -- cgit v1.2.1 From a04e905b622542ee93ffbed59e3fe521c921a346 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Mon, 7 Jan 2019 10:50:31 -0600 Subject: test 3940: adapt to new IDL4 capabilities --- .../Bug_3940_Regression/Bug_3940_Regression.mpc | 1 + TAO/tests/Bug_3940_Regression/test.idl | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/TAO/tests/Bug_3940_Regression/Bug_3940_Regression.mpc b/TAO/tests/Bug_3940_Regression/Bug_3940_Regression.mpc index 92fc577565c..18232e96e23 100644 --- a/TAO/tests/Bug_3940_Regression/Bug_3940_Regression.mpc +++ b/TAO/tests/Bug_3940_Regression/Bug_3940_Regression.mpc @@ -1,3 +1,4 @@ // -*- MPC -*- project (test3940) : taolib_with_idl { + idlflags += --idl-version 4 } diff --git a/TAO/tests/Bug_3940_Regression/test.idl b/TAO/tests/Bug_3940_Regression/test.idl index 0bb7fbcc68c..904c8910ddc 100644 --- a/TAO/tests/Bug_3940_Regression/test.idl +++ b/TAO/tests/Bug_3940_Regression/test.idl @@ -1,5 +1,25 @@ #if !defined (__BORLANDC__) +@annotation unit { + string value; +}; + +@annotation range { + double min; + double max; +}; + +@annotation min { + long value; +}; + +@annotation max { + long value; +}; + +@annotation key { +}; + module test { @unit("deg") -- cgit v1.2.1 From 50215baf3520095259c69c88f7bb770510962c23 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Mon, 7 Jan 2019 11:05:49 -0600 Subject: annotations test: fixed warnings and Perl script --- TAO/tests/IDLv4/annotations/be_init.cpp | 58 ++++++++++++++++----------------- TAO/tests/IDLv4/annotations/run_test.pl | 32 ++++++++---------- 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/TAO/tests/IDLv4/annotations/be_init.cpp b/TAO/tests/IDLv4/annotations/be_init.cpp index 4c0f555e600..5fe0bce2f56 100644 --- a/TAO/tests/IDLv4/annotations/be_init.cpp +++ b/TAO/tests/IDLv4/annotations/be_init.cpp @@ -522,7 +522,7 @@ BE_post_init (char *[], long) "};\n" ).assert_annotation_decl ("::@test_annotation_1"); t.assert_annotation_member_count (test_annotation_1, 0); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Declaration with Members"); @@ -555,7 +555,7 @@ BE_post_init (char *[], long) t.get_annotation_member (test_annotation_2, "boolean_value"); t.assert_annotation_member_type (boolean_value, AST_Expression::EV_bool); t.assert_annotation_member_no_value (boolean_value); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Declaration with Defaulted Members"); @@ -588,7 +588,7 @@ BE_post_init (char *[], long) t.get_annotation_member (test_annotation_3, "boolean_value"); t.assert_annotation_member_type (boolean_value, AST_Expression::EV_bool); t.assert_annotation_member_value (boolean_value, false); - } catch (Failed &f) {} + } catch (Failed &) {} AST_Annotation_Decl *test_annotation_4 = 0; try { @@ -610,7 +610,7 @@ BE_post_init (char *[], long) t.get_annotation_member (test_annotation_4, "y"); t.assert_annotation_member_type (y, AST_Expression::EV_short); t.assert_annotation_member_value (y, 0); - } catch (Failed &f) {} + } catch (Failed &) {} AST_Annotation_Decl *test_annotation_in_module = 0; try { @@ -623,7 +623,7 @@ BE_post_init (char *[], long) ).assert_annotation_decl ( "::module_with_annotation_decl::@test_annotation"); t.assert_annotation_member_count (test_annotation_in_module, 0); - } catch (Failed &f) {} + } catch (Failed &) {} AST_Annotation_Decl *enum_annotation = 0; AST_Expression *enum_annotation_a = 0; @@ -659,7 +659,7 @@ BE_post_init (char *[], long) enum_annotation_c = c->constant_value(); t.assert_annotation_member_value (value, enum_annotation_a); - } catch (Failed &f) {} + } catch (Failed &) {} AST_Annotation_Decl *string_annotation = 0; try { @@ -676,7 +676,7 @@ BE_post_init (char *[], long) UTL_String test_string("This is some text"); t.assert_annotation_member_value (value, &test_string); - } catch (Failed &f) {} + } catch (Failed &) {} AST_Expression *constant_annotation_x = 0; AST_Expression *constant_annotation_y = 0; @@ -704,7 +704,7 @@ BE_post_init (char *[], long) constant_annotation_y = y->constant_value(); t.assert_annotation_member_value (value, constant_annotation_x); - } catch (Failed &f) {} + } catch (Failed &) {} /* ------------------------------------------------------------------------- * Annotations Applications @@ -725,7 +725,7 @@ BE_post_init (char *[], long) ).assert_node ("::module1"); t.assert_annotation_appl_count (module1, 1); t.assert_annotation_appl (module1, 0, test_annotation_1); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Struct Annotation Application"); @@ -737,7 +737,7 @@ BE_post_init (char *[], long) ).assert_node ("::struct1"); t.assert_annotation_appl_count (struct1, 1); t.assert_annotation_appl (struct1, 0, test_annotation_1); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Typedef Annotation Application"); @@ -773,7 +773,7 @@ BE_post_init (char *[], long) t.assert_annotation_appl (type, 0, enum_annotation); t.assert_annotation_appl (type, 1, string_annotation); t.assert_annotation_appl (type, 2, test_annotation_1); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Sequence Type Parameter Annotation Application"); @@ -841,7 +841,7 @@ BE_post_init (char *[], long) } t.failed (); } - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Constant Declarations Annotation Application"); @@ -851,7 +851,7 @@ BE_post_init (char *[], long) ).assert_node ("test_const"); t.assert_annotation_appl_count (test_const, 1); t.assert_annotation_appl (test_const, 0, test_annotation_1); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Multiple Annotation Applications"); @@ -865,7 +865,7 @@ BE_post_init (char *[], long) t.assert_annotation_appl_count (struct3, 2); t.assert_annotation_appl (struct3, 0, test_annotation_1); t.assert_annotation_appl (struct3, 1, test_annotation_1); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Application with a Single Parameter"); @@ -885,7 +885,7 @@ BE_post_init (char *[], long) AST_Annotation_Member *y = t.get_annotation_member (appl, "y"); t.assert_annotation_member_value (y, 0); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Application with Named Parameters"); @@ -905,7 +905,7 @@ BE_post_init (char *[], long) AST_Annotation_Member *y = t.get_annotation_member (appl, "y"); t.assert_annotation_member_value (y, 102); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Applications with Scoped Names"); @@ -919,7 +919,7 @@ BE_post_init (char *[], long) t.assert_annotation_appl_count (struct5, 2); t.assert_annotation_appl (struct5, 0, test_annotation_in_module); t.assert_annotation_appl (struct5, 1, test_annotation_in_module); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Applications on/in Unions"); @@ -986,7 +986,7 @@ BE_post_init (char *[], long) t.assert_node ("test_union::union_member_1"); t.assert_annotation_appl_count (union_member_1, 1); t.assert_annotation_appl (union_member_1, 0, test_annotation_1); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Applications on/in Enums"); @@ -1010,7 +1010,7 @@ BE_post_init (char *[], long) t.assert_node ("Test_Enum::TEST_ENUM_MEMBER_2"); t.assert_annotation_appl_count (TEST_ENUM_MEMBER_2, 1); t.assert_annotation_appl (TEST_ENUM_MEMBER_2, 0, test_annotation_1); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("By Default, Unknown Annotation Application Causes Warning"); @@ -1021,12 +1021,12 @@ BE_post_init (char *[], long) " short member;\n" "};\n" ); - } catch (Failed &f) {} + } catch (Failed &) {} try { idl_global->unknown_annotations_ = IDL_GlobalData::UNKNOWN_ANNOTATIONS_ERROR; - Annotation_Test t("Optionally, Unknown Annotation Application Causes Error"); + Annotation_Test t("Optionally, Unknown Annotation Application Causes Err"); t.last_error (UTL_Error::EIDL_LOOKUP_ERROR).error_count (1); t.run ( "struct struct10 {\n" @@ -1037,7 +1037,7 @@ BE_post_init (char *[], long) // Restore Default Behaivor idl_global->unknown_annotations_ = IDL_GlobalData::UNKNOWN_ANNOTATIONS_WARN_ONCE; - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Application with Enum"); @@ -1066,7 +1066,7 @@ BE_post_init (char *[], long) t.assert_annotation_appl (value, 2, enum_annotation); member = t.get_annotation_member (third, "value"); t.assert_annotation_member_value (member, enum_annotation_c); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Application with String"); @@ -1099,7 +1099,7 @@ BE_post_init (char *[], long) member = t.get_annotation_member (annotation, "value"); t.assert_annotation_member_value (member, &third_string); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Application with Constant"); @@ -1126,7 +1126,7 @@ BE_post_init (char *[], long) annotation = t.assert_annotation_appl (value, 2, constant_annotation); member = t.get_annotation_member (annotation, "value"); t.assert_annotation_member_value (member, 100); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotate Array Base Type"); @@ -1172,7 +1172,7 @@ BE_post_init (char *[], long) } t.failed (); } - } catch (Failed &f) {} + } catch (Failed &) {} /* ------------------------------------------------------------------------- * Annotation Names @@ -1190,7 +1190,7 @@ BE_post_init (char *[], long) " short member;\n" "};" ); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Names Can't Be \"annotation\""); @@ -1199,7 +1199,7 @@ BE_post_init (char *[], long) "@annotation annotation {\n" "};\n" ); - } catch (Failed &f) {} + } catch (Failed &) {} try { Annotation_Test t("Annotation Names Can Start with \"annotation\""); @@ -1211,7 +1211,7 @@ BE_post_init (char *[], long) " short member;\n" "};\n" ).assert_annotation_decl ("::@annotationannotation"); - } catch (Failed &f) {} + } catch (Failed &) {} // Done, Print Overall Results if (failed_test_count) diff --git a/TAO/tests/IDLv4/annotations/run_test.pl b/TAO/tests/IDLv4/annotations/run_test.pl index a1cad7ce3c7..1f58b600d6b 100755 --- a/TAO/tests/IDLv4/annotations/run_test.pl +++ b/TAO/tests/IDLv4/annotations/run_test.pl @@ -3,29 +3,25 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' if 0; use strict; -use Env (ACE_ROOT); +use Env qw(ACE_ROOT); use lib "$ACE_ROOT/bin"; -use PerlACE::Run_Test +use PerlACE::Run_Test; -my $status = 0; - -my $annotest_idl = PerlDDS::create_process ("annotest_idl", ""); +my $annotest_idl = new PerlACE::Process("annotest_idl", ""); print $annotest_idl->CommandLine (); $annotest_idl->Spawn (); my $annotest_idl_result = $annotest_idl->WaitKill (10); -if ($annotest_idl_result > 0) - { - print STDERR "ERROR: annotest_idl returned $annotest_idl_result\n"; - } -$status = 1 if $annotest_idl_result; +if ($annotest_idl_result > 0) { + print STDERR "ERROR: annotest_idl returned $annotest_idl_result\n"; +} + +my $status = 1 if $annotest_idl_result; -if ($status) - { - print STDERR "test FAILED"; - } -else - { - print "test PASSED"; - } +if ($status) { + print STDERR "test FAILED"; +} +else { + print "test PASSED"; +} exit $status -- cgit v1.2.1 From c666447a97ed81c1d83df8773654c92f5669fd26 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Mon, 7 Jan 2019 11:39:59 -0600 Subject: TAO_IDL eval: disable stderr logging during eval --- TAO/TAO_IDL/util/utl_global.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index 47e979ebc3a..794c6cf3cb5 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -1950,9 +1950,12 @@ IDL_GlobalData::eval (const char *string) tao_yy_scan_string (string); // emulate DRV_drive() + u_long const flags = ACE_LOG_MSG->flags (); + ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR); FE_yyparse (); idl_global->check_primary_keys (); AST_check_fwd_decls (); + ACE_LOG_MSG->set_flags (flags); // Have Flex Cleanup tao_yylex_destroy (); -- cgit v1.2.1 From 9319eee5830a164896b799228a97897f2a7c6f72 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Mon, 7 Jan 2019 14:46:02 -0600 Subject: annotations test: style and usage fixes --- TAO/tests/IDLv4/annotations/be_init.cpp | 142 ++++++++++++++++---------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/TAO/tests/IDLv4/annotations/be_init.cpp b/TAO/tests/IDLv4/annotations/be_init.cpp index 5fe0bce2f56..f2936a93376 100644 --- a/TAO/tests/IDLv4/annotations/be_init.cpp +++ b/TAO/tests/IDLv4/annotations/be_init.cpp @@ -34,7 +34,7 @@ BE_version () } int -BE_init (int&, ACE_TCHAR*[]) +BE_init (int &, ACE_TCHAR *[]) { ACE_NEW_RETURN (be_global, BE_GlobalData, -1); @@ -83,7 +83,7 @@ public: ACE_TEXT ("FAILED because of syntax error in:\n%C\n") ACE_TEXT ("Check Syntax Error Message Above For More Infomation\n"), name_, idl_)); - failed_test_count++; + ++failed_test_count; } else if (!failed_) { @@ -92,7 +92,7 @@ public: } } - void failed (const char * message = 0) + void failed (const char *message = 0) { if (message) { @@ -105,7 +105,7 @@ public: name_, idl_)); failed_test_count++; failed_ = true; - throw Failed(); + throw Failed (); } Annotation_Test &error_count (int error_count) @@ -234,7 +234,7 @@ public: AST_Annotation_Decl *assert_annotation_decl (const char *name) { - AST_Annotation_Decl *node = dynamic_cast( + AST_Annotation_Decl *node = dynamic_cast( assert_node (name)); if (node->node_type () != AST_Decl::NT_annotation_decl) @@ -360,7 +360,7 @@ public: AST_Annotation_Appl *anno_appl, size_t count) { assert_annotation_member_count ( - dynamic_cast(anno_appl), count); + dynamic_cast(anno_appl), count); } AST_Annotation_Member *get_annotation_member ( @@ -368,7 +368,7 @@ public: { AST_Decl *decl = (*anno_decl)[name]; AST_Annotation_Member *member = decl ? - AST_Annotation_Member::narrow_from_decl(decl) : 0; + AST_Annotation_Member::narrow_from_decl (decl) : 0; if (!member) { ACE_ERROR ((LM_ERROR, @@ -384,7 +384,7 @@ public: AST_Annotation_Appl *anno_appl, const char *name) { return get_annotation_member( - dynamic_cast(anno_appl), name); + dynamic_cast(anno_appl), name); } void assert_annotation_member_type ( @@ -516,16 +516,16 @@ BE_post_init (char *[], long) AST_Annotation_Decl *test_annotation_1 = 0; try { - Annotation_Test t("Annotation Declaration with No Members"); + Annotation_Test t ("Annotation Declaration with No Members"); test_annotation_1 = t.run ( "@annotation test_annotation_1 {\n" "};\n" ).assert_annotation_decl ("::@test_annotation_1"); t.assert_annotation_member_count (test_annotation_1, 0); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Declaration with Members"); + Annotation_Test t ("Annotation Declaration with Members"); AST_Annotation_Decl *test_annotation_2 = t.run ( "@annotation test_annotation_2 {\n" " short short_value;\n" @@ -555,10 +555,10 @@ BE_post_init (char *[], long) t.get_annotation_member (test_annotation_2, "boolean_value"); t.assert_annotation_member_type (boolean_value, AST_Expression::EV_bool); t.assert_annotation_member_no_value (boolean_value); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Declaration with Defaulted Members"); + Annotation_Test t ("Annotation Declaration with Defaulted Members"); AST_Annotation_Decl *test_annotation_3 = t.run ( "@annotation test_annotation_3 {\n" " short short_value default 1;\n" @@ -588,11 +588,11 @@ BE_post_init (char *[], long) t.get_annotation_member (test_annotation_3, "boolean_value"); t.assert_annotation_member_type (boolean_value, AST_Expression::EV_bool); t.assert_annotation_member_value (boolean_value, false); - } catch (Failed &) {} + } catch (Failed const &) {} AST_Annotation_Decl *test_annotation_4 = 0; try { - Annotation_Test t("Annotation Declaration with Mixed Members"); + Annotation_Test t ("Annotation Declaration with Mixed Members"); test_annotation_4 = t.run ( "@annotation test_annotation_4 {\n" " short x;\n" @@ -610,11 +610,11 @@ BE_post_init (char *[], long) t.get_annotation_member (test_annotation_4, "y"); t.assert_annotation_member_type (y, AST_Expression::EV_short); t.assert_annotation_member_value (y, 0); - } catch (Failed &) {} + } catch (Failed const &) {} AST_Annotation_Decl *test_annotation_in_module = 0; try { - Annotation_Test t("Annotation Declaration In Module"); + Annotation_Test t ("Annotation Declaration In Module"); test_annotation_in_module = t.run ( "module module_with_annotation_decl {\n" " @annotation test_annotation {\n" @@ -623,14 +623,14 @@ BE_post_init (char *[], long) ).assert_annotation_decl ( "::module_with_annotation_decl::@test_annotation"); t.assert_annotation_member_count (test_annotation_in_module, 0); - } catch (Failed &) {} + } catch (Failed const &) {} AST_Annotation_Decl *enum_annotation = 0; AST_Expression *enum_annotation_a = 0; AST_Expression *enum_annotation_b = 0; AST_Expression *enum_annotation_c = 0; try { - Annotation_Test t("Annotation Declaration with Enum"); + Annotation_Test t ("Annotation Declaration with Enum"); enum_annotation = t.run ( "@annotation enum_annotation {\n" " enum Enum_t {\n" @@ -659,11 +659,11 @@ BE_post_init (char *[], long) enum_annotation_c = c->constant_value(); t.assert_annotation_member_value (value, enum_annotation_a); - } catch (Failed &) {} + } catch (Failed const &) {} AST_Annotation_Decl *string_annotation = 0; try { - Annotation_Test t("Annotation Declaration with String"); + Annotation_Test t ("Annotation Declaration with String"); string_annotation = t.run ( "@annotation string_annotation {\n" " string value default \"This is some text\";\n" @@ -676,13 +676,13 @@ BE_post_init (char *[], long) UTL_String test_string("This is some text"); t.assert_annotation_member_value (value, &test_string); - } catch (Failed &) {} + } catch (Failed const &) {} AST_Expression *constant_annotation_x = 0; AST_Expression *constant_annotation_y = 0; AST_Annotation_Decl *constant_annotation = 0; try { - Annotation_Test t("Annotation Declaration with Constant"); + Annotation_Test t ("Annotation Declaration with Constant"); constant_annotation = t.run ( "@annotation constant_annotation {\n" " const short X = 4;\n" @@ -704,7 +704,7 @@ BE_post_init (char *[], long) constant_annotation_y = y->constant_value(); t.assert_annotation_member_value (value, constant_annotation_x); - } catch (Failed &) {} + } catch (Failed const &) {} /* ------------------------------------------------------------------------- * Annotations Applications @@ -714,7 +714,7 @@ BE_post_init (char *[], long) */ try { - Annotation_Test t("Module Annotation Application"); + Annotation_Test t ("Module Annotation Application"); AST_Decl *module1 = t.run ( "@test_annotation_1\n" "module module1 {\n" @@ -725,10 +725,10 @@ BE_post_init (char *[], long) ).assert_node ("::module1"); t.assert_annotation_appl_count (module1, 1); t.assert_annotation_appl (module1, 0, test_annotation_1); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Struct Annotation Application"); + Annotation_Test t ("Struct Annotation Application"); AST_Decl *struct1 = t.run ( "@test_annotation_1\n" "struct struct1 {\n" @@ -737,10 +737,10 @@ BE_post_init (char *[], long) ).assert_node ("::struct1"); t.assert_annotation_appl_count (struct1, 1); t.assert_annotation_appl (struct1, 0, test_annotation_1); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Typedef Annotation Application"); + Annotation_Test t ("Typedef Annotation Application"); t.run ( "@enum_annotation\n" "typedef short short_int;\n" @@ -765,7 +765,7 @@ BE_post_init (char *[], long) { t.failed ("Could Not Get member"); } - AST_Decl* type = dynamic_cast (member->field_type ()); + AST_Decl* type = dynamic_cast (member->field_type ()); // Assert type has enum_annotation, string_annotation, and // test_annotation_1. @@ -773,10 +773,10 @@ BE_post_init (char *[], long) t.assert_annotation_appl (type, 0, enum_annotation); t.assert_annotation_appl (type, 1, string_annotation); t.assert_annotation_appl (type, 2, test_annotation_1); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Sequence Type Parameter Annotation Application"); + Annotation_Test t ("Sequence Type Parameter Annotation Application"); AST_Decl *value_decl = t.run ( "typedef sequence<@test_annotation_1 short, 5> test_seq_t;\n" "struct struct7 {\n" @@ -792,13 +792,13 @@ BE_post_init (char *[], long) "Could Not Convert struct7::value from AST_Decl into AST_Field"); } AST_Typedef *typedef_node = - dynamic_cast (value->field_type ()); + dynamic_cast (value->field_type ()); if (!typedef_node) { t.failed ( "Could Not Convert test_seq_t from AST_Decl into AST_Typedef"); } - AST_Decl *seq_decl = dynamic_cast(typedef_node->base_type ()); + AST_Decl *seq_decl = dynamic_cast(typedef_node->base_type ()); AST_Sequence *seq = AST_Sequence::narrow_from_decl (seq_decl); if (!seq) { @@ -841,20 +841,20 @@ BE_post_init (char *[], long) } t.failed (); } - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Constant Declarations Annotation Application"); + Annotation_Test t ("Constant Declarations Annotation Application"); AST_Decl *test_const = t.run ( "@test_annotation_1\n" "const short test_const = 5;\n" ).assert_node ("test_const"); t.assert_annotation_appl_count (test_const, 1); t.assert_annotation_appl (test_const, 0, test_annotation_1); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Multiple Annotation Applications"); + Annotation_Test t ("Multiple Annotation Applications"); AST_Decl *struct3 = t.run ( "@test_annotation_1\n" "@test_annotation_1\n" @@ -865,10 +865,10 @@ BE_post_init (char *[], long) t.assert_annotation_appl_count (struct3, 2); t.assert_annotation_appl (struct3, 0, test_annotation_1); t.assert_annotation_appl (struct3, 1, test_annotation_1); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Application with a Single Parameter"); + Annotation_Test t ("Annotation Application with a Single Parameter"); AST_Decl *struct4 = t.run ( "@test_annotation_4 (100)\n" "struct struct4 {\n" @@ -885,10 +885,10 @@ BE_post_init (char *[], long) AST_Annotation_Member *y = t.get_annotation_member (appl, "y"); t.assert_annotation_member_value (y, 0); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Application with Named Parameters"); + Annotation_Test t ("Annotation Application with Named Parameters"); AST_Decl *struct2 = t.run ( "@test_annotation_4 (x = 101, y = 102)\n" "struct struct2 {\n" @@ -905,10 +905,10 @@ BE_post_init (char *[], long) AST_Annotation_Member *y = t.get_annotation_member (appl, "y"); t.assert_annotation_member_value (y, 102); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Applications with Scoped Names"); + Annotation_Test t ("Annotation Applications with Scoped Names"); AST_Decl *struct5 = t.run ( "@module_with_annotation_decl::test_annotation\n" "@::module_with_annotation_decl::test_annotation\n" @@ -919,10 +919,10 @@ BE_post_init (char *[], long) t.assert_annotation_appl_count (struct5, 2); t.assert_annotation_appl (struct5, 0, test_annotation_in_module); t.assert_annotation_appl (struct5, 1, test_annotation_in_module); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Applications on/in Unions"); + Annotation_Test t ("Annotation Applications on/in Unions"); AST_Decl *test_union_decl = t.run ( /* Annotations on the union and the discriminator */ "@test_annotation_1\n" @@ -986,10 +986,10 @@ BE_post_init (char *[], long) t.assert_node ("test_union::union_member_1"); t.assert_annotation_appl_count (union_member_1, 1); t.assert_annotation_appl (union_member_1, 0, test_annotation_1); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Applications on/in Enums"); + Annotation_Test t ("Annotation Applications on/in Enums"); AST_Decl *Test_Enum = t.run ( /* Annotation on the enum */ "@test_annotation_1\n" @@ -1010,10 +1010,10 @@ BE_post_init (char *[], long) t.assert_node ("Test_Enum::TEST_ENUM_MEMBER_2"); t.assert_annotation_appl_count (TEST_ENUM_MEMBER_2, 1); t.assert_annotation_appl (TEST_ENUM_MEMBER_2, 0, test_annotation_1); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("By Default, Unknown Annotation Application Causes Warning"); + Annotation_Test t ("By Default, Unknown Annotation Application Causes Warning"); t.last_warning (UTL_Error::EIDL_LOOKUP_ERROR); t.run ( "struct struct11 {\n" @@ -1021,12 +1021,12 @@ BE_post_init (char *[], long) " short member;\n" "};\n" ); - } catch (Failed &) {} + } catch (Failed const &) {} try { idl_global->unknown_annotations_ = IDL_GlobalData::UNKNOWN_ANNOTATIONS_ERROR; - Annotation_Test t("Optionally, Unknown Annotation Application Causes Err"); + Annotation_Test t ("Optionally, Unknown Annotation Application Causes Err"); t.last_error (UTL_Error::EIDL_LOOKUP_ERROR).error_count (1); t.run ( "struct struct10 {\n" @@ -1037,10 +1037,10 @@ BE_post_init (char *[], long) // Restore Default Behaivor idl_global->unknown_annotations_ = IDL_GlobalData::UNKNOWN_ANNOTATIONS_WARN_ONCE; - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Application with Enum"); + Annotation_Test t ("Annotation Application with Enum"); AST_Decl *value = t.run ( "struct struct8 {\n" " @enum_annotation\n" // A @@ -1066,10 +1066,10 @@ BE_post_init (char *[], long) t.assert_annotation_appl (value, 2, enum_annotation); member = t.get_annotation_member (third, "value"); t.assert_annotation_member_value (member, enum_annotation_c); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Application with String"); + Annotation_Test t ("Annotation Application with String"); AST_Decl *value = t.run ( "struct struct9 {\n" " @string_annotation\n" // A @@ -1085,24 +1085,24 @@ BE_post_init (char *[], long) UTL_String first_string("This is some text"); annotation = t.assert_annotation_appl (value, 0, string_annotation); member = t.get_annotation_member (annotation, "value"); - t.assert_annotation_member_value + t.assert_annotation_member_value (member, &first_string); UTL_String second_string("Something else"); annotation = t.assert_annotation_appl (value, 1, string_annotation); member = t.get_annotation_member (annotation, "value"); - t.assert_annotation_member_value + t.assert_annotation_member_value (member, &second_string); UTL_String third_string("One last thing"); annotation = t.assert_annotation_appl (value, 2, string_annotation); member = t.get_annotation_member (annotation, "value"); - t.assert_annotation_member_value + t.assert_annotation_member_value (member, &third_string); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Application with Constant"); + Annotation_Test t ("Annotation Application with Constant"); AST_Decl *value = t.run ( "struct struct12 {\n" " @constant_annotation\n" // A @@ -1126,15 +1126,15 @@ BE_post_init (char *[], long) annotation = t.assert_annotation_appl (value, 2, constant_annotation); member = t.get_annotation_member (annotation, "value"); t.assert_annotation_member_value (member, 100); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotate Array Base Type"); + Annotation_Test t ("Annotate Array Base Type"); AST_Typedef *thetypedef = AST_Typedef::narrow_from_decl (t.run ( "typedef struct12 struct12Array @test_annotation_1 [12];\n" ).assert_node ("::struct12Array")); AST_Array *struct12Array = - dynamic_cast (thetypedef->base_type ()); + dynamic_cast (thetypedef->base_type ()); // Verify Annotation on Base Type AST_Annotation_Appls *annotations = @@ -1172,7 +1172,7 @@ BE_post_init (char *[], long) } t.failed (); } - } catch (Failed &) {} + } catch (Failed const &) {} /* ------------------------------------------------------------------------- * Annotation Names @@ -1182,7 +1182,7 @@ BE_post_init (char *[], long) */ try { - Annotation_Test t("Annotation and Non-Annotation Names Can't Clash"); + Annotation_Test t ("Annotation and Non-Annotation Names Can't Clash"); t.run ( "@annotation samename {\n" "};\n" @@ -1190,19 +1190,19 @@ BE_post_init (char *[], long) " short member;\n" "};" ); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Names Can't Be \"annotation\""); + Annotation_Test t ("Annotation Names Can't Be \"annotation\""); t.last_error (UTL_Error::EIDL_MISC).error_count (1); t.run ( "@annotation annotation {\n" "};\n" ); - } catch (Failed &) {} + } catch (Failed const &) {} try { - Annotation_Test t("Annotation Names Can Start with \"annotation\""); + Annotation_Test t ("Annotation Names Can Start with \"annotation\""); t.run ( "@annotation annotationannotation {\n" "};\n" @@ -1211,7 +1211,7 @@ BE_post_init (char *[], long) " short member;\n" "};\n" ).assert_annotation_decl ("::@annotationannotation"); - } catch (Failed &) {} + } catch (Failed const &) {} // Done, Print Overall Results if (failed_test_count) -- cgit v1.2.1