Re: pointer check in unit tests

2020-11-05 Thread Michael Stahl
On 05.11.20 10:09, Michael Stahl wrote: On 03.11.20 10:21, Stephan Bergmann wrote: On 03/11/2020 09:37, Miklos Vajna wrote: (If you see a case where a pointer is returned and it can't be ever nullptr, then we should fix the return type to a be reference. Caolan did lots of fixes like that recen

Re: pointer check in unit tests

2020-11-05 Thread Michael Stahl
On 03.11.20 10:21, Stephan Bergmann wrote: On 03/11/2020 09:37, Miklos Vajna wrote: (If you see a case where a pointer is returned and it can't be ever nullptr, then we should fix the return type to a be reference. Caolan did lots of fixes like that recently.) That's up for debate.  For exampl

Re: pointer check in unit tests

2020-11-04 Thread Stephan Bergmann
On 04/11/2020 12:06, Mike Kaganski wrote: On 04.11.2020 13:51, Stephan Bergmann wrote: That a reference is something completely different than a pointer shows e.g. in the rule that if a class has an implicit copy constructor and a non-static data member of reference type, then the copy constru

Re: pointer check in unit tests

2020-11-04 Thread Mike Kaganski
On 04.11.2020 13:51, Stephan Bergmann wrote: That a reference is something completely different than a pointer shows e.g. in the rule that if a class has an implicit copy constructor and a non-static data member of reference type, then the copy constructor is defined as deleted (while there is

Re: pointer check in unit tests

2020-11-04 Thread Stephan Bergmann
On 04/11/2020 11:35, Mike Kaganski wrote: On 04.11.2020 12:51, Stephan Bergmann wrote: On 04/11/2020 08:26, Miklos Vajna wrote: If a never-nullptr pointer is returned, it would be really useful to somehow state that in the function's signature. Are you aware of any way to do that? There is C's

Re: pointer check in unit tests

2020-11-04 Thread Mike Kaganski
On 04.11.2020 12:51, Stephan Bergmann wrote: On 04/11/2020 08:26, Miklos Vajna wrote: If a never-nullptr pointer is returned, it would be really useful to somehow state that in the function's signature. Are you aware of any way to do that? There is C's __attribute__((nonnull)), but it only works

Re: pointer check in unit tests

2020-11-04 Thread Stephan Bergmann
On 04/11/2020 08:26, Miklos Vajna wrote: If a never-nullptr pointer is returned, it would be really useful to somehow state that in the function's signature. Are you aware of any way to do that? There is C's __attribute__((nonnull)), but it only works on function parameters, I think. see "not_n

Re: pointer check in unit tests

2020-11-03 Thread Miklos Vajna
Hi Stephan, On Tue, Nov 03, 2020 at 10:21:34AM +0100, Stephan Bergmann wrote: > On 03/11/2020 09:37, Miklos Vajna wrote: > > (If you see a case where a pointer is returned and it can't be ever > > nullptr, then we should fix the return type to a be reference. Caolan > > did lots of fixes like th

Re: pointer check in unit tests

2020-11-03 Thread Regina Henschel
Hi Miklos, Stephan, Mike, I have kept all those asserts for now. Changing ScBootstrapFixture::loadDoc would be a separate task anyway. Kind regards Regina Mike Kaganski schrieb am 03-Nov-20 um 10:22: On 03.11.2020 11:37, Miklos Vajna wrote: Hi Regina, On Mon, Nov 02, 2020 at 07:52:54PM +010

Re: pointer check in unit tests

2020-11-03 Thread Mike Kaganski
On 03.11.2020 11:37, Miklos Vajna wrote: Hi Regina, On Mon, Nov 02, 2020 at 07:52:54PM +0100, Regina Henschel wrote: ScDocShellRef xDocSh = loadDoc("tdf137020_FlipVertical.", FORMAT_ODS); CPPUNIT_ASSERT_MESSAGE("Failed to load tdf137020_FlipVertical.ods", xDocSh.is()); ScDocument& rDoc = xDoc

Re: pointer check in unit tests

2020-11-03 Thread Stephan Bergmann
On 03/11/2020 09:37, Miklos Vajna wrote: (If you see a case where a pointer is returned and it can't be ever nullptr, then we should fix the return type to a be reference. Caolan did lots of fixes like that recently.) That's up for debate. For example, if a sufficiently large fraction of call

Re: pointer check in unit tests

2020-11-03 Thread Miklos Vajna
Hi Regina, On Mon, Nov 02, 2020 at 07:52:54PM +0100, Regina Henschel wrote: > ScDocShellRef xDocSh = loadDoc("tdf137020_FlipVertical.", FORMAT_ODS); > CPPUNIT_ASSERT_MESSAGE("Failed to load tdf137020_FlipVertical.ods", > xDocSh.is()); > ScDocument& rDoc = xDocSh->GetDocument(); > ScDrawLayer* pD