summaryrefslogtreecommitdiff
path: root/cmds/idmap2/tests/ResultTests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Prefer `= delete` in place of DISALLOW_COPY_AND_ASSIGN.Stephen Hines2020-08-221-1/+2
| | | | | | | | | | | | | Clang-tidy expects modernized code to prefer deleting copy constructors and assignment operators to legacy macros. /disk/android_trees/aosp-master-plus-llvm/frameworks/base/cmds/idmap2/tests/ResultTests.cpp:263:3: error: prefer deleting copy constructor and assignment operator over using macro 'DISALLOW_COPY_AND_ASSIGN' [modernize-replace-disal low-copy-and-assign-macro,-warnings-as-errors] DISALLOW_COPY_AND_ASSIGN(NoCopyContainer); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bug: http://b/155835175 Test: mm in idmap2 Change-Id: I3bb29b48a478a67cbda959f47b271ccf8543a768
* Run idmap2 static-checks and fix formatting issuesRyan Mitchell2019-04-151-1/+0
| | | | | | Bug: 130324774 Test: builds Change-Id: I2cf9d3aa268ffe38e525fadee9d81fc6aefe19b1
* idmap2: switch to improved Result classMårten Kongstad2019-02-271-42/+42
| | | | | | | | Remove the old std::optional based Result class, replace uses with the new std::variant based Result class. Test: make idmap2_tests Change-Id: I401cb36e5af06133a2872d835cf29bfb0b106597
* idmap2: introduce improved Result classMårten Kongstad2019-02-061-0/+288
Add a new version of the Result class that functions like the old Result, but in case of an error, also encodes a string detailing the error. This will allow us to write the following type of code: Result<Foo> CreateFoo() { if (...) { return Error("errno=%d", errno()); } return Foo(...); } auto foo = CreateFoo(); if (!foo) { std::cerr << "error: " << foo.GetErrorMessage() << std::endl; abort(); } std::cout << "foo=" << *foo << std::endl; This commit only adds the new Result class. A later change will replace uses of the old version. Test: make idmap2_tests Change-Id: I674d8a06866402adedf85f8514400f25840d5eda