-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from jwillemsen/jwi-defaultliteraltest
Add default_literal test
- Loading branch information
Showing
5 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @file client.cpp | ||
* @author Johnny Willemsen | ||
* | ||
* @brief CORBA C++11 client application | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
#include "testC.h" | ||
#include "testlib/taox11_testlog.h" | ||
|
||
int main (int /*argc*/, char* /*argv*/[]) | ||
{ | ||
int retval {}; | ||
Shape shape; | ||
shape.color_seq().resize(5); | ||
|
||
TAOX11_TEST_INFO << "shape: " << shape << std::endl; | ||
|
||
if (shape.color_red() != Color::RED) | ||
{ | ||
TAOX11_TEST_ERROR << "shape.color_red() not RED but: " << shape.color_red() << std::endl; | ||
++retval; | ||
} | ||
for (const auto& arrayi : shape.color_red_array()) | ||
{ | ||
if (arrayi != Color::RED) | ||
{ | ||
TAOX11_TEST_ERROR << "shape.color_red_array() not RED but: " << arrayi << std::endl; | ||
++retval; | ||
} | ||
} | ||
for (size_t i = 0; i < shape.color_seq().size(); ++i) | ||
{ | ||
if (shape.color_seq()[i] != Color::RED) | ||
{ | ||
// Not supported, see D4982 | ||
// TAOX11_TEST_ERROR << "shape.color_seq()[" << i << "] not RED but: " << shape.color_seq()[i] << std::endl; | ||
// ++retval; | ||
} | ||
} | ||
|
||
return retval; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#--------------------------------------------------------------------- | ||
# @file run_test.pl | ||
# @author Marcel Smit | ||
# | ||
# @copyright Copyright (c) Remedy IT Expertise BV | ||
#--------------------------------------------------------------------- | ||
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; | ||
|
||
my $target = PerlACE::TestTarget::create_target(2) || die "Create target 2 failed\n"; | ||
|
||
$status = 0; | ||
|
||
$SV = $target->CreateProcess ("client"); | ||
|
||
$server = $SV->SpawnWaitKill ($target->ProcessStartWaitInterval()); | ||
|
||
if ($server != 0) { | ||
print STDERR "ERROR: client returned $server\n"; | ||
$status = 1; | ||
} | ||
|
||
$target->GetStderrLog(); | ||
|
||
exit $status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @file test.idl | ||
* @author Johnny Willemsen | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
enum Color { | ||
GREEN, | ||
@default_literal RED, | ||
BLUE | ||
}; | ||
|
||
typedef Color ColorArray[5]; | ||
typedef sequence<Color> ColorSeq; | ||
|
||
struct Shape { | ||
Color color_red; | ||
ColorArray color_red_array; | ||
ColorSeq color_seq; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// -*- MPC -*- | ||
|
||
project(*defaultliteral_gen_idl): ridl_ostream_defaults { | ||
IDL_Files { | ||
test.idl | ||
idlflags += --idl-version=4 | ||
} | ||
custom_only = 1 | ||
} | ||
|
||
project(*defaultliteral_client): taox11_client { | ||
after += *defaultliteral_gen_idl | ||
Source_Files { | ||
client.cpp | ||
} | ||
Source_Files { | ||
testC.cpp | ||
} | ||
} | ||
|