summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Mitz <mitza@objectcomputing.com>2021-08-27 10:43:30 -0500
committerGitHub <noreply@github.com>2021-08-27 10:43:30 -0500
commitd035863b2a8cbf4ddade856ac723bbacecddaeb8 (patch)
treefb0b197b3f8cee4b6f9601c4009a68ab32ea9dd6
parentbf432d958de94c70854ef82642eb9da71543c7d8 (diff)
parent01c351d947d384751554b134232ca98a9e2f0a42 (diff)
downloadATCD-d035863b2a8cbf4ddade856ac723bbacecddaeb8.tar.gz
Merge pull request #1665 from mitza-oci/ast-fixed-6
[TAO 2] TAO_IDL_FE: NT_fixed needs owns_base_type in typedef
-rw-r--r--TAO/MPC/config/tao_idl_fe.mpb2
-rw-r--r--TAO/TAO_IDL/ast/ast_field.cpp2
-rw-r--r--TAO/bin/tao_orb_tests.lst1
-rw-r--r--TAO/tests/AST_Unit_Tests/.gitignore1
-rw-r--r--TAO/tests/AST_Unit_Tests/AST_Unit_Tests.cpp30
-rw-r--r--TAO/tests/AST_Unit_Tests/AST_Unit_Tests.mpc2
-rwxr-xr-xTAO/tests/AST_Unit_Tests/run_test.pl29
-rw-r--r--TAO/tests/IDLv4/annotations/annotest_idl.mpc6
8 files changed, 68 insertions, 5 deletions
diff --git a/TAO/MPC/config/tao_idl_fe.mpb b/TAO/MPC/config/tao_idl_fe.mpb
index bcc73c92ef9..ec69567b46f 100644
--- a/TAO/MPC/config/tao_idl_fe.mpb
+++ b/TAO/MPC/config/tao_idl_fe.mpb
@@ -1,5 +1,5 @@
// -*- MPC -*-
-project: acelib, conv_lib {
+project: acelib {
includes += $(TAO_ROOT)/TAO_IDL/fe $(TAO_ROOT)/TAO_IDL/include $(TAO_ROOT)
after += TAO_IDL_FE
libs += TAO_IDL_FE
diff --git a/TAO/TAO_IDL/ast/ast_field.cpp b/TAO/TAO_IDL/ast/ast_field.cpp
index 8ff7cb8321e..fa3157e0925 100644
--- a/TAO/TAO_IDL/ast/ast_field.cpp
+++ b/TAO/TAO_IDL/ast/ast_field.cpp
@@ -103,6 +103,7 @@ AST_Field::AST_Field (AST_Type *ft,
this->owns_base_type_ =
fnt == AST_Decl::NT_array
|| fnt == AST_Decl::NT_sequence
+ || fnt == AST_Decl::NT_fixed
|| fnt == AST_Decl::NT_param_holder;
if (fnt == AST_Decl::NT_param_holder)
@@ -135,6 +136,7 @@ AST_Field::AST_Field (AST_Decl::NodeType nt,
this->owns_base_type_ =
fnt == AST_Decl::NT_array
|| fnt == AST_Decl::NT_sequence
+ || fnt == AST_Decl::NT_fixed
|| fnt == AST_Decl::NT_param_holder;
if (fnt == AST_Decl::NT_param_holder)
diff --git a/TAO/bin/tao_orb_tests.lst b/TAO/bin/tao_orb_tests.lst
index 46bba23e670..fb439b2b43e 100644
--- a/TAO/bin/tao_orb_tests.lst
+++ b/TAO/bin/tao_orb_tests.lst
@@ -509,3 +509,4 @@ TAO/DevGuideExamples/AMH/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO
TAO/DevGuideExamples/AMH_AMI/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO
TAO/tests/IDLv4/annotations/run_test.pl
TAO/tests/IDLv4/explicit_ints/run_test.pl
+TAO/tests/AST_Unit_Tests/run_test.pl
diff --git a/TAO/tests/AST_Unit_Tests/.gitignore b/TAO/tests/AST_Unit_Tests/.gitignore
new file mode 100644
index 00000000000..8e7d97b1527
--- /dev/null
+++ b/TAO/tests/AST_Unit_Tests/.gitignore
@@ -0,0 +1 @@
+/AST_Unit_Tests
diff --git a/TAO/tests/AST_Unit_Tests/AST_Unit_Tests.cpp b/TAO/tests/AST_Unit_Tests/AST_Unit_Tests.cpp
new file mode 100644
index 00000000000..33ac27086d6
--- /dev/null
+++ b/TAO/tests/AST_Unit_Tests/AST_Unit_Tests.cpp
@@ -0,0 +1,30 @@
+#include "../Sequence_Unit_Tests/test_macros.h"
+
+#include <ast_fixed.h>
+#include <ast_typedef.h>
+#include <fe_extern.h>
+#include <utl_identifier.h>
+
+#include <cstdlib>
+
+int test_fixed_typedef ()
+{
+ Identifier id_fixed ("fixed");
+ UTL_ScopedName name_fixed (&id_fixed, 0);
+ AST_Expression digits (22), scale (2);
+ AST_Fixed fixed (&name_fixed, &digits, &scale);
+
+ Identifier id_typedef ("Myfixed");
+ UTL_ScopedName name_typedef (&id_typedef, 0);
+ AST_Typedef td (&fixed, &name_typedef, false, false);
+ CHECK (td.owns_base_type ());
+ return EXIT_SUCCESS;
+}
+
+int ACE_TMAIN (int, ACE_TCHAR *[])
+{
+ FE_init ();
+ int status = EXIT_SUCCESS;
+ status += test_fixed_typedef ();
+ return status;
+}
diff --git a/TAO/tests/AST_Unit_Tests/AST_Unit_Tests.mpc b/TAO/tests/AST_Unit_Tests/AST_Unit_Tests.mpc
new file mode 100644
index 00000000000..8f15b2f913c
--- /dev/null
+++ b/TAO/tests/AST_Unit_Tests/AST_Unit_Tests.mpc
@@ -0,0 +1,2 @@
+project: aceexe, tao_idl_fe {
+}
diff --git a/TAO/tests/AST_Unit_Tests/run_test.pl b/TAO/tests/AST_Unit_Tests/run_test.pl
new file mode 100755
index 00000000000..887f4f7bf68
--- /dev/null
+++ b/TAO/tests/AST_Unit_Tests/run_test.pl
@@ -0,0 +1,29 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::TestTarget;
+use strict;
+
+my $process = 'AST_Unit_Tests';
+my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $P = $server->CreateProcess ($process);
+
+print "Running $process ...\n";
+my $result = $P->Spawn;
+if ($result != 0) {
+ print "FAILED $process\n";
+ exit 1;
+}
+
+$result = $P->WaitKill ($server->ProcessStartWaitInterval ());
+if ($result != 0) {
+ print "FAILED $process\n";
+ exit 1;
+}
+
+print "SUCCESS\n";
+exit 0;
diff --git a/TAO/tests/IDLv4/annotations/annotest_idl.mpc b/TAO/tests/IDLv4/annotations/annotest_idl.mpc
index 4f0b53d2071..cace56b57e2 100644
--- a/TAO/tests/IDLv4/annotations/annotest_idl.mpc
+++ b/TAO/tests/IDLv4/annotations/annotest_idl.mpc
@@ -1,6 +1,4 @@
-project: aceexe {
+project: aceexe, tao_idl_fe {
exename = *
- after += TAO_IDL_FE
- libs += TAO_IDL_FE
- includes += . $(TAO_ROOT)/TAO_IDL/include $(TAO_ROOT)/TAO_IDL/fe $(TAO_ROOT)
+ includes += .
}