-
-
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 #404 from jwillemsen/jwi-idl4enumtest
Test and fix enum bit_bound/value annotations
- Loading branch information
Showing
8 changed files
with
505 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/** | ||
* @file foo.cpp | ||
* @author Johnny Willemsen | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
#include "foo.h" | ||
|
||
#include "testlib/taox11_testlog.h" | ||
|
||
Foo::Foo (IDL::traits<CORBA::ORB>::ref_type orb, | ||
IDL::traits<PortableServer::POA>::ref_type poa) | ||
: orb_ (std::move(orb)) | ||
, poa_ (std::move(poa)) | ||
{ | ||
} | ||
|
||
MyEnum | ||
Foo::test_myenum (MyEnum sin, | ||
MyEnum & sinout, | ||
MyEnum & sout) | ||
{ | ||
if (sin != MyEnum::flag0) | ||
{ | ||
TAOX11_TEST_ERROR << "ERROR: test_myenum: Received incorrect sin<" << sin << ">" << std::endl; | ||
} | ||
else | ||
{ | ||
TAOX11_TEST_DEBUG << "test_myenum: Received sin<" << sin << ">" << std::endl; | ||
} | ||
if (sinout != MyEnum::flag1) | ||
{ | ||
TAOX11_TEST_ERROR << "ERROR: test_myenum: Received incorrect sinout<" << sinout << ">" << std::endl; | ||
} | ||
else | ||
{ | ||
TAOX11_TEST_DEBUG << "test_myenum: Received sinout<" << sinout << ">" << std::endl; | ||
} | ||
sout = sin; | ||
if (sout != MyEnum::flag0) | ||
{ | ||
TAOX11_TEST_ERROR << "ERROR: test_myenum: Setting sout failed <" << sout << ">" << std::endl; | ||
} | ||
sinout = sin; | ||
return MyEnum::flag2; | ||
} | ||
|
||
MyEnumBound8 | ||
Foo::test_myenumbound8 (MyEnumBound8 sin, | ||
MyEnumBound8 & sinout, | ||
MyEnumBound8 & sout) | ||
{ | ||
if (sin != MyEnumBound8::flag8_2) | ||
{ | ||
TAOX11_TEST_ERROR << "ERROR: MyEnumBound8: Received incorrect sin<" << sin << ">" << std::endl; | ||
} | ||
sout = sin; | ||
sinout = sin; | ||
MyEnumBound8 sret = sin; | ||
return sret; | ||
} | ||
|
||
MyEnumBound16 | ||
Foo::test_myenumbound16 (MyEnumBound16 sin, | ||
MyEnumBound16 & sinout, | ||
MyEnumBound16 & sout) | ||
{ | ||
if (sin != MyEnumBound16::flag16_2) | ||
{ | ||
TAOX11_TEST_ERROR << "ERROR: MyEnumBound16: Received incorrect sin<" << sin << ">" << std::endl; | ||
} | ||
sout = sin; | ||
sinout = sin; | ||
MyEnumBound16 sret = sin; | ||
return sret; | ||
} | ||
|
||
MyEnumBound32 | ||
Foo::test_myenumbound32 (MyEnumBound32 sin, | ||
MyEnumBound32 & sinout, | ||
MyEnumBound32 & sout) | ||
{ | ||
if (sin != MyEnumBound32::flag32_2) | ||
{ | ||
TAOX11_TEST_ERROR << "ERROR: MyEnumBound32: Received incorrect sin<" << sin << ">" << std::endl; | ||
} | ||
sout = sin; | ||
sinout = sin; | ||
MyEnumBound32 sret = sin; | ||
return sret; | ||
} | ||
|
||
MyValueEnum | ||
Foo::test_myvalueenum (MyValueEnum sin, | ||
MyValueEnum & sinout, | ||
MyValueEnum & sout) | ||
{ | ||
if (sin != MyValueEnum::myv4) | ||
{ | ||
TAOX11_TEST_ERROR << "ERROR: MyValueEnum: Received incorrect sin<" << sin << ">" << std::endl; | ||
} | ||
sout = sin; | ||
sinout = sin; | ||
MyValueEnum sret = sin; | ||
return sret; | ||
} | ||
|
||
void | ||
Foo::shutdown () | ||
{ | ||
this->orb_->shutdown (false); | ||
} |
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,37 @@ | ||
/** | ||
* @file foo.h | ||
* @author Johnny Willemsen | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
#ifndef FOO_H | ||
#define FOO_H | ||
|
||
#include "testS.h" | ||
|
||
class Foo final | ||
: public virtual CORBA::servant_traits<Test::Foo>::base_type | ||
{ | ||
public: | ||
/// Constructor | ||
Foo (IDL::traits<CORBA::ORB>::ref_type orb, | ||
IDL::traits<PortableServer::POA>::ref_type poa); | ||
|
||
// = The skeleton methods | ||
MyEnum test_myenum (MyEnum sin, MyEnum & sinout, MyEnum & sout) override; | ||
MyEnumBound8 test_myenumbound8 (MyEnumBound8 sin, MyEnumBound8 & sinout, MyEnumBound8 & sout) override; | ||
MyEnumBound16 test_myenumbound16 (MyEnumBound16 sin, MyEnumBound16 & sinout, MyEnumBound16 & sout) override; | ||
MyEnumBound32 test_myenumbound32 (MyEnumBound32 sin, MyEnumBound32 & sinout, MyEnumBound32 & sout) override; | ||
MyValueEnum test_myvalueenum (const MyValueEnum sin, MyValueEnum & sinout, MyValueEnum & sout) override; | ||
|
||
void shutdown () override; | ||
|
||
private: | ||
/// Use an ORB reference shutdown the server. | ||
IDL::traits<CORBA::ORB>::ref_type orb_; | ||
/// Use a POA reference to activate the references to | ||
// the template module interface. | ||
IDL::traits<PortableServer::POA>::ref_type poa_; | ||
}; | ||
|
||
#endif /* FOO_H */ |
Oops, something went wrong.