Fix Optional test for -fb platform
authorNicholas Ormrod <njormrod@fb.com>
Wed, 20 Aug 2014 01:23:44 +0000 (18:23 -0700)
committerSara Golemon <sgolemon@fb.com>
Tue, 9 Sep 2014 21:22:22 +0000 (14:22 -0700)
commit1cab639b34226bb2fe6934e2e271db3131e74f68
tree311d637a2d43296857423e40068eed94142e8bc3
parent33f1f3d15f72ebd9f48704a3ec358d123ef60ea0
Fix Optional test for -fb platform

Summary:
The Optional test relied on std::string clearing its data when
it is the source of a move. This does not happen for in-situ fbstrings,
so the test breaks in the -fb platform. The solution: wrap the string in
a class that explicitly invalidates its data upon a move.

Test Plan:
fbconfig --platform-all=gcc-4.8.1-glibc-2.17-fb -r folly
fbmake runtests
fbconfig -r folly
fbmake runtests

Reviewed By: tudorb@fb.com

Subscribers: sdwilsh

FB internal diff: D1506840

Tasks: 4943996
folly/test/OptionalTest.cpp