-
-
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 #304 from jwillemsen/jwi-idl4enumbitbound
New IDL4 test for enum bit_bound
- Loading branch information
Showing
14 changed files
with
220 additions
and
3 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
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
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
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,56 @@ | ||
/** | ||
* @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" | ||
#include <type_traits> | ||
|
||
int main (int /*argc*/, char* /*argv*/[]) | ||
{ | ||
// Just compilation test | ||
|
||
MyEnum my_bitenum; | ||
X11_UNUSED_ARG(my_bitenum); | ||
|
||
if (sizeof(uint8_t) != sizeof(MyEnumBound8)) | ||
{ | ||
TAOX11_TEST_ERROR << "Type of MyEnumBound8 is not uint8_t" << std::endl; | ||
} | ||
if (sizeof(uint16_t) != sizeof (MyEnumBound16)) | ||
{ | ||
TAOX11_TEST_ERROR << "Type of MyEnumBound16 is not uint16_t" << std::endl; | ||
} | ||
if (sizeof(uint32_t) != sizeof (MyEnumBound32)) | ||
{ | ||
TAOX11_TEST_ERROR << "Type of MyEnumBound32 is not uint32_t" << std::endl; | ||
} | ||
if (sizeof(uint32_t) != sizeof (MyEnum)) | ||
{ | ||
TAOX11_TEST_ERROR << "Type of MyEnum is not uint32_t" << std::endl; | ||
} | ||
|
||
if (IDL::traits<MyEnumBound8>::bit_bound::value != 8) | ||
{ | ||
TAOX11_TEST_ERROR << "bit_bound traits MyEnumBound8 is 8" << std::endl; | ||
} | ||
if (IDL::traits<MyEnumBound16>::bit_bound::value != 16) | ||
{ | ||
TAOX11_TEST_ERROR << "bit_bound traits MyEnumBound16 is 16" << std::endl; | ||
} | ||
if (IDL::traits<MyEnumBound32>::bit_bound::value != 32) | ||
{ | ||
TAOX11_TEST_ERROR << "bit_bound traits MyEnumBound32 is 32" << std::endl; | ||
} | ||
if (IDL::traits<MyEnum>::bit_bound::value != 32) | ||
{ | ||
TAOX11_TEST_ERROR << "bit_bound traits MyEnum is 32" << std::endl; | ||
} | ||
|
||
return 0; | ||
} |
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: const 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,33 @@ | ||
/** | ||
* @file test.idl | ||
* @author Johnny Willemsen | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
enum MyEnum { | ||
flag0, | ||
flag1, | ||
flag2 | ||
}; | ||
|
||
@bit_bound(8) | ||
enum MyEnumBound8 { | ||
flag8_1, | ||
flag8_2, | ||
flag8_3 | ||
}; | ||
|
||
@bit_bound(16) | ||
enum MyEnumBound16 { | ||
flag16_1, | ||
flag16_2, | ||
flag16_3 | ||
}; | ||
|
||
@bit_bound(32) | ||
enum MyEnumBound32 { | ||
flag32_1, | ||
flag32_2, | ||
flag32_3 | ||
}; |
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(*idl4_enum_gen_idl): ridl_ostream_defaults { | ||
IDL_Files { | ||
test.idl | ||
idlflags += --idl-version=4 -Scdr | ||
} | ||
custom_only = 1 | ||
} | ||
|
||
project(*idl4_enum_client): taox11_client { | ||
after += *idl4_enum_gen_idl | ||
Source_Files { | ||
client.cpp | ||
} | ||
Source_Files { | ||
testC.cpp | ||
} | ||
} | ||
|
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,15 @@ | ||
/** | ||
* @file enum_bitbound_33.idl | ||
* @author Johnny Willemsen | ||
* | ||
* ridlc shall reject use of a enum with a bit_bound annotation with value 33 | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
@bit_bound(33) | ||
enum MyBitMask { | ||
flag0, | ||
flag1, | ||
flag2 | ||
}; |
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,15 @@ | ||
/** | ||
* @file enum_bitbound_missingvalue.idl | ||
* @author Johnny Willemsen | ||
* | ||
* ridlc shall reject use of a enum with a bit_bound annotation with no value | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
@bit_bound() | ||
enum MyBitMask { | ||
flag0, | ||
flag1, | ||
flag2 | ||
}; |
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,15 @@ | ||
/** | ||
* @file enum_bitbound_negative.idl | ||
* @author Johnny Willemsen | ||
* | ||
* ridlc shall reject use of a enum with a negative bit_bound value | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
@bit_bound(-1) | ||
enum MyBitMask { | ||
flag0, | ||
flag1, | ||
flag2 | ||
}; |
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,15 @@ | ||
/** | ||
* @file enum_bitbound_zero.idl | ||
* @author Johnny Willemsen | ||
* | ||
* ridlc shall reject use of a enum with a bit_bound annotation with value zero | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
@bit_bound(0) | ||
enum MyBitMask { | ||
flag0, | ||
flag1, | ||
flag2 | ||
}; |