-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for long long integers as native types #1142
Commits on Aug 11, 2018
-
add support for long long integers as native types
When testing code that needs to work on both 64-bit platforms and 32-bit platforms, the long integer may not guarantee 64bits of width on the 32-bit platform. This makes testing calls which take and return 64bit values difficult, as the test framework can't handle these natively. Add support for long long integers, so that test code can natively handle these larger values. Note, to avoid ABI compatibility issues, use cpputest_longlong and cpputest_ulonglong. This ensures the virtual function tables are the same whether long long support is enabled or disabled. With this patch, if long long support is disabled in CppUTest, then the mock withParameter and returnParameter functions will fail indicating that the long long support is not enabled. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 6e90b18 - Browse repository at this point
Copy the full SHA 6e90b18View commit details -
return 0 for the actual call traces
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 684d528 - Browse repository at this point
Copy the full SHA 684d528View commit details -
consistently typecast when converting sign of a value
Use long long int, instead of long int, and type cast only when we are converting from a signed to an unsigned type, or vice versa. Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0faa126 - Browse repository at this point
Copy the full SHA 0faa126View commit details -
use a consistent order for the comparisons of other integer types
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 2ee5bda - Browse repository at this point
Copy the full SHA 2ee5bdaView commit details -
use correct accessor when returning long long int value
Otherwise we will inadvertently return a potentially smaller sized value, resulting in incorrect return values. This fixes tests on various 32 bit platforms. Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0cedfc2 - Browse repository at this point
Copy the full SHA 0cedfc2View commit details -
use correct longInt accessor in equality test
We incorrectly accessed the longLongIntValue_ section of the union when comparing a lont int and an unsigned long long int. This resulted in incorrect behavior on some 32bit platforms. This is likely due to the union not being zero initialized. Fix this by using the correct accessor, longIntValue_. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 33ac61d - Browse repository at this point
Copy the full SHA 33ac61dView commit details -
remove unnecessary <climits> header
It was originally added due to thinking we needed it for ULLONG_MAX definitions. Technically, we probably *do* need it, but it likely gets included through some other file. Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for cfe36d6 - Browse repository at this point
Copy the full SHA cfe36d6View commit details -
fix incorrect #ifdef for CPPUTEST_USE_LONG_LONG
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1170768 - Browse repository at this point
Copy the full SHA 1170768View commit details -
move related MockParameterTests together
Combined all of the mismatched long long and other type tests into one block. This reduces the number of checks for CPPUTEST_USE_LONG_LONG, and hopefully makes the code easier to read. I chose not to move the expectOne*ParameterAndValue tests, because these are not related to the mismatched type tests, and I wanted to keep similar tests together. Moving them would make the test layout a bit more confusing. Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 233f864 - Browse repository at this point
Copy the full SHA 233f864View commit details