Skip to content

Commit 08af7f5

Browse files
committed
[doc] cppnow-2017
1 parent 59538e9 commit 08af7f5

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

docs/cppnow-2017/index.html

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
* Dependency Inversion Principle
7373
* Automatic Mocks Injection
7474
* TDD/BDD
75-
* Showcase (User Story -> ... -> Commit)
75+
* Showcase
7676
* C++2X...
7777

7878
==============================================================================
@@ -200,7 +200,7 @@
200200
```cpp
201201
GTEST("Can add numbers") {
202202
// set-up
203-
SHOULD("add 2 numbers") { EXPECT_EQ(4, add(2, 2)); }
203+
SHOULD("add 2 numbers") { EXPECT(4 == add(2, 2)); }
204204
// tear-down
205205
}
206206
```
@@ -365,7 +365,7 @@
365365
```cpp
366366
class MockReader { // no inheritance
367367
public:
368-
MOCK_CONST_METHOD1(read, int());
368+
MOCK_CONST_METHOD0(read, int());
369369
};
370370
```
371371

@@ -1388,7 +1388,7 @@
13881388

13891389
==============================================================================
13901390

1391-
## Showcase (User Story -> ... -> Commit)
1391+
## Showcase (User Story -> ... -> Merge Request)
13921392

13931393
![ats](images/ats.png)
13941394

@@ -1752,7 +1752,7 @@
17521752
#### Merged by a team member, only if:
17531753
* All code review dicussions were resolved
17541754
* All checks are passing
1755-
* all tests/static,dynamic analysis, etc...
1755+
* All tests/static,dynamic analysis, etc...
17561756

17571757
----
17581758

@@ -1806,13 +1806,34 @@
18061806

18071807
----
18081808

1809+
### Static reflection - Mocks generation
1810+
1811+
```cpp
1812+
template<class T>
1813+
$class GMock {
1814+
public:
1815+
virtual ~GMock() noexcept { }
1816+
constexpr {
1817+
for... (auto f: $GMock.functions()) {
1818+
f.make([] { fs...; });
1819+
}
1820+
}
1821+
1822+
private:
1823+
flat_map<string, unique_ptr<UntypedFunctionMockerBase>> fs{};
1824+
};
1825+
```
1826+
1827+
----
1828+
18091829
### Proposals
18101830

18111831
| | |
18121832
|-|-|
1813-
| Mocks Generation | [(SG7) Static reflection](www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0194r0.pdf) |
1814-
| Type constraints | [(SG8) Concepts lite](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3580.pdf) |
1815-
| Concepts based type erasure | [Virtual Concepts](https://github.com/andyprowl/virtual-concepts/blob/master/draft/Dynamic%20Generic%20Programming%20with%20Virtual%20Concepts.pdf) |
1833+
| [(SG7) Static reflection](www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0194r0.pdf) | Mocks Generation |
1834+
| [(SG8) Concepts lite](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3580.pdf) | Type constraints |
1835+
| [Virtual Concepts](https://github.com/andyprowl/virtual-concepts/blob/master/draft/Dynamic%20Generic%20Programming%20with%20Virtual%20Concepts.pdf) | Concepts based type erasure |
1836+
| ? | Testing/Assertions |
18161837

18171838
==============================================================================
18181839

@@ -1825,7 +1846,7 @@
18251846
* Consider using a good* testing framework
18261847
* Consider using a good* Mocking framework
18271848
* Consider writing `SOLID` instead of `STUPID` code
1828-
* Consider using dependency injection framework
1849+
* Consider using dependency injection framework to avoid the wiring mess and inject mocks automatically
18291850
* Consider writing tests before the implementation
18301851

18311852
----

0 commit comments

Comments
 (0)