summaryrefslogtreecommitdiff
path: root/xsd/tests/cxx/tree/binary/polymorphic
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/tests/cxx/tree/binary/polymorphic')
-rw-r--r--xsd/tests/cxx/tree/binary/polymorphic/driver.cxx24
-rw-r--r--xsd/tests/cxx/tree/binary/polymorphic/makefile17
2 files changed, 30 insertions, 11 deletions
diff --git a/xsd/tests/cxx/tree/binary/polymorphic/driver.cxx b/xsd/tests/cxx/tree/binary/polymorphic/driver.cxx
index 3c3e057..8e7256e 100644
--- a/xsd/tests/cxx/tree/binary/polymorphic/driver.cxx
+++ b/xsd/tests/cxx/tree/binary/polymorphic/driver.cxx
@@ -1,16 +1,17 @@
// file : tests/cxx/tree/binary/polymorphic/driver.cxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC
+// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
// Test polymorphic binary serialization.
//
-#include <memory> // std::auto_ptr
+#include <memory> // std::auto_ptr/unique_ptr
#include <cassert>
#include <iostream>
#include <typeinfo>
+#include <ace/Log_Msg.h> // ACE_HEX_DUMP
+
#include "test.hxx"
using namespace std;
@@ -27,7 +28,7 @@ main (int argc, char* argv[])
try
{
- auto_ptr<type> r (root (argv[1]));
+ XSD_AUTO_PTR<type> r (root (argv[1]));
// Save to a CDR stream.
//
@@ -35,11 +36,24 @@ main (int argc, char* argv[])
xml_schema::ostream<ACE_OutputCDR> ocdr (ace_ocdr);
ocdr << *r;
+ /*
+ // Print the binary representation.
+ //
+ cerr << "binary representation size: " << ace_ocdr.total_length () << endl;
+
+ for (const ACE_Message_Block* mb = ace_ocdr.begin ();
+ mb != 0;
+ mb = mb->cont ())
+ {
+ ACE_HEX_DUMP ((LM_DEBUG, mb->rd_ptr (), mb->length ()));
+ }
+ */
+
// Load from a CDR stream.
//
ACE_InputCDR ace_icdr (ace_ocdr);
xml_schema::istream<ACE_InputCDR> icdr (ace_icdr);
- auto_ptr<type> c (new type (icdr));
+ XSD_AUTO_PTR<type> c (new type (icdr));
// Compare the two.
//
diff --git a/xsd/tests/cxx/tree/binary/polymorphic/makefile b/xsd/tests/cxx/tree/binary/polymorphic/makefile
index 7e97e00..05c5186 100644
--- a/xsd/tests/cxx/tree/binary/polymorphic/makefile
+++ b/xsd/tests/cxx/tree/binary/polymorphic/makefile
@@ -1,6 +1,5 @@
# file : tests/cxx/tree/binary/polymorphic/makefile
-# author : Boris Kolpackov <boris@codesynthesis.com>
-# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC
+# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC
# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make
@@ -30,18 +29,19 @@ $(call import,\
#
$(driver): $(obj) $(xerces_c.l) $(ace.l)
-$(obj) $(dep): cpp_options := -I$(src_root)/libxsd
+$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd
$(obj) $(dep): $(xerces_c.l.cpp-options) $(ace.l.cpp-options)
genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx)
gen := $(addprefix $(out_base)/,$(genf))
$(gen): xsd := $(out_root)/xsd/xsd
-$(gen): xsd_options := --generate-polymorphic --root-element-last \
---generate-insertion ACE_OutputCDR --generate-extraction ACE_InputCDR
+$(gen): xsd_options += --generate-polymorphic --root-element-last \
+--generate-insertion ACE_OutputCDR --generate-extraction ACE_InputCDR \
+ --generate-comparison
$(gen): $(out_root)/xsd/xsd
-$(call include-dep,$(dep))
+$(call include-dep,$(dep),$(obj),$(gen))
# Convenience alias for default target.
#
@@ -78,7 +78,12 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+
+$(call include,$(bld_root)/cxx/standard.make) # cxx_standard
+ifdef cxx_standard
+$(gen): xsd_options += --std $(cxx_standard)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
+endif
# Dependencies.