Repository navigation
Fix BoolKeys test to use integer-to-bool cast - #25862
saisindhuri91 wants to merge 1 commit into
Conversation
| // First element. | ||
| EXPECT_TRUE(upb_inttable_next(&t, &key, &val, &iter)); | ||
| bool key_bool; | ||
| memcpy(&key_bool, &key, sizeof(key_bool)); |
There was a problem hiding this comment.
Maybe this instead?
bool key_bool = upb_value_getbool(key)
There was a problem hiding this comment.
Hi @esrauchg,
Thank you for reviewing the code..
- I tried using
upb_value_getbool(key), but it gives compilation errorerror: could not convert 'key' from 'uintptr_t' to 'upb_value' - The reason is that upb_value_getbool() expects an argument of type upb_value (which is a struct wrapper used for the values of type
uint64_t) - And, upb_inttable_next arguments mentions the
keyexplicitly as a rawuintptr_t, not as aupb_value - So, we cannot use
upb_value_getboolon thekey, instead we can cast theuintptr_tdirectly
|
Thanks for this fix! The Re the reviewer's suggestion to use We've been tracking protobuf s390x issues downstream (we pin protobuf in our builds) and even though this is just a test fix, it would be great to see this merged. |
|
Hi @esrauchg, |
|
Hi @saisindhuri91, looks like there are tests failing. Please fix. |
02774a2 to
5ce0d04
Compare
Thanks @karenwuz. The earlier CI failures were due to the old commit in the branch. Now I have rebased onto the latest main. The diff is still the same in @esrauchg could you please re-add the Thank you... |
5ce0d04 to
c3da332
Compare
Signed-off-by: saisindhuri91 <[email protected]>
c3da332 to
c9c5ca9
Compare
This PR has been raised to resolve the following test case failure
//upb/hash:testoccurred in s390x:Error:Solution:key_bool = static_cast<bool>(key);