| Index: util/misc/random_string.cc
|
| diff --git a/snapshot/mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc b/util/misc/random_string.cc
|
| similarity index 71%
|
| copy from snapshot/mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc
|
| copy to util/misc/random_string.cc
|
| index 2ba9bee043af4a606c8d6c90bb8a2b73b5867edb..a522799ad1611b67e86ae4dc33e7904867bd778c 100644
|
| --- a/snapshot/mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc
|
| +++ b/util/misc/random_string.cc
|
| @@ -12,20 +12,18 @@
|
| // See the License for the specific language governing permissions and
|
| // limitations under the License.
|
|
|
| +#include "util/misc/random_string.h"
|
| +
|
| +#include "base/rand_util.h"
|
| +
|
| namespace crashpad {
|
| -namespace test {
|
| -namespace {
|
|
|
| -class CrashyClass {
|
| - public:
|
| - CrashyClass() {
|
| - __builtin_trap();
|
| +std::string RandomString() {
|
| + std::string random_string;
|
| + for (int index = 0; index < 16; ++index) {
|
| + random_string.append(1, static_cast<char>(base::RandInt('A', 'Z')));
|
| }
|
| -};
|
| -
|
| -// __attribute__((used)) keeps the dead code stripper away.
|
| -__attribute__((used)) CrashyClass g_crashy_object;
|
| + return random_string;
|
| +}
|
|
|
| -} // namespace
|
| -} // namespace test
|
| } // namespace crashpad
|
|
|