diff options
author | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-02-13 23:37:14 +0000 |
---|---|---|
committer | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-02-13 23:37:14 +0000 |
commit | 3a94b8b4f589c5a20e62e9b4835a9bb458dc2400 (patch) | |
tree | 2af7e3b188bf3b12c6bdb9877ca44f87ab0ff431 /system_wrappers/source/stringize_macros_unittest.cc | |
parent | 13e46dc786cba0e262a7cc3b5f3f6028e1972231 (diff) | |
download | webrtc-3a94b8b4f589c5a20e62e9b4835a9bb458dc2400.tar.gz |
Import stringize_macros from Chromium.
Committing the originals to make further reviews cleaner.
TBR=bjornv
BUG=webrtc:1395
Review URL: https://webrtc-codereview.appspot.com/1106005
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3509 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'system_wrappers/source/stringize_macros_unittest.cc')
-rw-r--r-- | system_wrappers/source/stringize_macros_unittest.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/system_wrappers/source/stringize_macros_unittest.cc b/system_wrappers/source/stringize_macros_unittest.cc new file mode 100644 index 00000000..d7f9e560 --- /dev/null +++ b/system_wrappers/source/stringize_macros_unittest.cc @@ -0,0 +1,29 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/strings/stringize_macros.h" + +#include "testing/gtest/include/gtest/gtest.h" + +// Macros as per documentation in header file. +#define PREPROCESSOR_UTIL_UNITTEST_A FOO +#define PREPROCESSOR_UTIL_UNITTEST_B(x) myobj->FunctionCall(x) +#define PREPROCESSOR_UTIL_UNITTEST_C "foo" + +TEST(StringizeTest, Ansi) { + EXPECT_STREQ( + "PREPROCESSOR_UTIL_UNITTEST_A", + STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_A)); + EXPECT_STREQ( + "PREPROCESSOR_UTIL_UNITTEST_B(y)", + STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_B(y))); + EXPECT_STREQ( + "PREPROCESSOR_UTIL_UNITTEST_C", + STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_C)); + + EXPECT_STREQ("FOO", STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_A)); + EXPECT_STREQ("myobj->FunctionCall(y)", + STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_B(y))); + EXPECT_STREQ("\"foo\"", STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_C)); +} |