diff options
Diffstat (limited to 'bindgen-integration/cpp')
-rw-r--r-- | bindgen-integration/cpp/Test.cc | 45 | ||||
-rw-r--r-- | bindgen-integration/cpp/Test.h | 18 |
2 files changed, 49 insertions, 14 deletions
diff --git a/bindgen-integration/cpp/Test.cc b/bindgen-integration/cpp/Test.cc index f125109a..57c2186b 100644 --- a/bindgen-integration/cpp/Test.cc +++ b/bindgen-integration/cpp/Test.cc @@ -69,11 +69,11 @@ Date2::assert(unsigned short nWeekDay, unsigned short nYear, unsigned short byte) { - return this->nWeekDay == nWeekDay && - this->nMonthDay == nMonthDay && - this->nMonth == nMonth && - this->nYear == nYear && - this->byte == byte; + return this->nWeekDay == nWeekDay && + this->nMonthDay == nMonthDay && + this->nMonth == nMonth && + this->nYear == nYear && + this->byte == byte; } bool @@ -83,11 +83,11 @@ Fifth::assert(unsigned short nWeekDay, unsigned short nYear, unsigned char byte) { - return this->nWeekDay == nWeekDay && - this->nMonthDay == nMonthDay && - this->nMonth == nMonth && - this->nYear == nYear && - this->byte == byte; + return this->nWeekDay == nWeekDay && + this->nMonthDay == nMonthDay && + this->nMonth == nMonth && + this->nYear == nYear && + this->byte == byte; } bool @@ -95,10 +95,27 @@ Sixth::assert(unsigned char byte, unsigned char nWeekDay, unsigned char nMonth, unsigned char nMonthDay) { - return this->nWeekDay == nWeekDay && - this->nMonthDay == nMonthDay && - this->nMonth == nMonth && - this->byte == byte; + return this->nWeekDay == nWeekDay && + this->nMonthDay == nMonthDay && + this->nMonth == nMonth && + this->byte == byte; +}; + +bool +Seventh::assert(bool first, + int second, + unsigned short third, + unsigned int fourth, + unsigned short fifth, + bool sixth, + int seventh) { + return this->first_one_bit == first && + this->second_thirty_bits == second && + this->third_two_bits == third && + this->fourth_thirty_bits == fourth && + this->fifth_two_bits == fifth && + this->sixth_one_bit == sixth && + this->seventh_thirty_bits == seventh; }; } // namespace bitfields diff --git a/bindgen-integration/cpp/Test.h b/bindgen-integration/cpp/Test.h index e23a32e6..7ddb98bd 100644 --- a/bindgen-integration/cpp/Test.h +++ b/bindgen-integration/cpp/Test.h @@ -121,6 +121,24 @@ struct Sixth { unsigned char nMonthDay); }; +struct Seventh { + bool first_one_bit : 1; + unsigned int second_thirty_bits : 30; + unsigned short third_two_bits : 2; + unsigned int fourth_thirty_bits : 30; + unsigned short fifth_two_bits : 2; + bool sixth_one_bit : 1; + unsigned int seventh_thirty_bits : 30; + + /// Returns true if the bitfields match the arguments, false otherwise. + bool assert(bool first, + int second, + unsigned short third, + unsigned int fourth, + unsigned short fifth, + bool sixth, + int seventh); +}; } // namespace bitfields |