Page MenuHomePhabricator

[iOS] Fix `CryptoTest.mm`
ClosedPublic

Authored by atul on May 12 2022, 11:47 AM.
Tags
None
Referenced Files
F3395943: D4020.diff
Sun, Dec 1, 9:21 AM
Unknown Object (File)
Fri, Nov 29, 4:30 AM
Unknown Object (File)
Tue, Nov 19, 5:27 PM
Unknown Object (File)
Tue, Nov 19, 5:27 PM
Unknown Object (File)
Tue, Nov 19, 5:27 PM
Unknown Object (File)
Tue, Nov 19, 5:27 PM
Unknown Object (File)
Tue, Nov 19, 5:25 PM
Unknown Object (File)
Thu, Nov 14, 9:10 AM

Details

Summary

These tests weren't building, and as a result weren't able to be run, etc.

Goal is to eventually add these tests to the iOS CI, but ran into some issues with simulator architectures and whatnot so will handle that in a subsequent diff.

Test Plan

Tests run and pass (from Xcode GUI):

159d.png (694×724 px, 147 KB)

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul added a reviewer: karol.
Harbormaster returned this revision to the author for changes because remote builds failed.May 12 2022, 11:55 AM
Harbormaster failed remote builds in B9045: Diff 12589!
atul requested review of this revision.May 12 2022, 12:12 PM

I have no clue what's going on here. Going to unassign myself.

tomek added inline comments.
native/ios/CommTests/CryptoTest.mm
49

Is this approach better than simply assigning the value?

This revision is now accepted and ready to land.May 16 2022, 10:36 AM
native/ios/CommTests/CryptoTest.mm
49

Based on what I've read, the best practice is to always use braced initialization.. don't feel strongly and pretty sure it wouldn't make a difference here

Using braces {} to initialize a variable is, unsurprisingly, called braced initialization. Part of the reason C++ initialization syntax is such a mess is that the language grew out of C, where object life cycles are primitive, into a language with a robust and featureful object life cycle. Language designers incorporated braced initialization into modern C++ to help smooth over the sharp corners this has caused in the initialization syntax. In short, no matter the object’s scope or type, braced initialization is always applicable, whereas the other notations are not. Later in the chapter, you’ll learn a general rule that encourages widespread use of braced initialization.

native/ios/CommTests/CryptoTest.mm
49

1258.png (2×1 px, 395 KB)

This revision was automatically updated to reflect the committed changes.