Lines Matching refs:scoper
97 // return a temporarily constructed version of the scoper.
112 scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
114 EXPECT_TRUE(scoper.get());
116 EXPECT_EQ(10, scoper->SomeMeth(10));
117 EXPECT_EQ(10, scoper.get()->SomeMeth(10));
118 EXPECT_EQ(10, (*scoper).SomeMeth(10));
124 scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
126 EXPECT_TRUE(scoper.get());
128 scoper.reset(new ConDecLogger(&constructed));
130 EXPECT_TRUE(scoper.get());
132 scoper.reset();
134 EXPECT_FALSE(scoper.get());
136 scoper.reset(new ConDecLogger(&constructed));
138 EXPECT_TRUE(scoper.get());
140 ConDecLogger* take = scoper.release();
142 EXPECT_FALSE(scoper.get());
146 scoper.reset(new ConDecLogger(&constructed));
148 EXPECT_TRUE(scoper.get());
180 scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
182 EXPECT_TRUE(scoper.get());
184 scoped_ptr<ConDecLoggerParent> scoper_parent(std::move(scoper));
187 EXPECT_FALSE(scoper.get());
197 scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
199 EXPECT_TRUE(scoper.get());
202 scoper_parent = std::move(scoper);
205 EXPECT_FALSE(scoper.get());
211 scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
213 EXPECT_TRUE(scoper.get());
215 scoped_ptr<const ConDecLogger> scoper_const(std::move(scoper));
218 EXPECT_FALSE(scoper.get());
228 scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
230 EXPECT_TRUE(scoper.get());
233 scoper_const = std::move(scoper);
236 EXPECT_FALSE(scoper.get());
246 scoped_ptr<double, CountingDeleter> scoper(&dummy_value,
251 EXPECT_TRUE(scoper);
257 scoper = std::move(scoper_child);
258 EXPECT_TRUE(scoper);
263 scoper.reset();
264 EXPECT_FALSE(scoper);
292 scoped_ptr<ConDecLogger[]> scoper(new ConDecLogger[kNumLoggers]);
293 EXPECT_TRUE(scoper);
294 EXPECT_EQ(&scoper[0], scoper.get());
296 scoper[i].SetPtr(&constructed);
300 EXPECT_EQ(10, scoper.get()->SomeMeth(10));
301 EXPECT_EQ(10, scoper[2].SomeMeth(10));
307 scoped_ptr<ConDecLogger[]> scoper;
308 EXPECT_FALSE(scoper.get());
309 EXPECT_FALSE(scoper.release());
310 EXPECT_FALSE(scoper.get());
311 scoper.reset();
312 EXPECT_FALSE(scoper.get());
314 scoper.reset(new ConDecLogger[kNumLoggers]);
316 scoper[i].SetPtr(&constructed);
319 scoper.reset();
322 scoper.reset(new ConDecLogger[kNumLoggers]);
324 scoper[i].SetPtr(&constructed);
327 ConDecLogger* ptr = scoper.release();
363 scoped_ptr<ConDecLogger[]> scoper(loggers);
364 EXPECT_TRUE(scoper);
366 scoper[i].SetPtr(&constructed);
371 scoped_ptr<ConDecLogger[]> scoper2(std::move(scoper));
378 EXPECT_FALSE(scoper);
389 scoped_ptr<ConDecLogger> scoper(logger);
393 scoped_ptr<ConDecLogger> scoper2(std::move(scoper));
400 EXPECT_FALSE(scoper.get());
411 scoped_ptr<ConDecLogger> scoper(logger);
415 scoped_ptr<ConDecLogger>&& rvalue = scoper.Pass();
417 EXPECT_TRUE(scoper.get());
426 scoped_ptr<ConDecLogger> scoper(logger);
430 GrabAndDrop(std::move(scoper));
431 EXPECT_FALSE(scoper.get());
442 scoped_ptr<ConDecLogger> scoper(logger);
445 PassThru(std::move(scoper));
446 EXPECT_FALSE(scoper.get());
453 scoped_ptr<ConDecLogger> scoper(logger);
457 PassThru(std::move(scoper));
458 EXPECT_FALSE(scoper.get());
478 scoped_ptr<double, CountingDeleter> scoper(&dummy_value,
481 EXPECT_TRUE(scoper.get());
488 scoped_ptr<double, CountingDeleter> scoper(NULL,
490 EXPECT_FALSE(scoper.get());
491 EXPECT_FALSE(scoper.release());
492 EXPECT_FALSE(scoper.get());
493 scoper.reset();
494 EXPECT_FALSE(scoper.get());
497 scoper.reset(&dummy_value);
498 scoper.reset();
501 scoper.reset(&dummy_value);
502 EXPECT_EQ(&dummy_value, scoper.release());
510 scoped_ptr<double, CountingDeleter> scoper(&dummy_value,
514 scoper.get_deleter()(&dummy_value);
518 scoper.reset();
520 scoper.get_deleter()(&dummy_value);
524 scoper.get_deleter() = CountingDeleter(&alternate_deletes);
525 scoper.reset(&dummy_value);
537 scoped_ptr<double, CountingDeleter> scoper(&dummy_value,
549 scoper = std::move(scoper3);
591 scoped_ptr<OverloadedNewAndDelete> scoper(new OverloadedNewAndDelete());
592 EXPECT_TRUE(scoper.get());
594 scoped_ptr<OverloadedNewAndDelete> scoper2(std::move(scoper));