summaryrefslogtreecommitdiff
path: root/Tests/CompileDefinitions
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 10:34:04 -0400
committerBrad King <brad.king@kitware.com>2016-05-16 16:05:19 -0400
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Tests/CompileDefinitions
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadcmake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
Diffstat (limited to 'Tests/CompileDefinitions')
-rw-r--r--Tests/CompileDefinitions/compiletest.cpp64
-rw-r--r--Tests/CompileDefinitions/compiletest_mixed_c.c1
-rw-r--r--Tests/CompileDefinitions/compiletest_mixed_cxx.cpp2
-rw-r--r--Tests/CompileDefinitions/runtest.c27
-rw-r--r--Tests/CompileDefinitions/target_prop/usetgt.c11
5 files changed, 55 insertions, 50 deletions
diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp
index 7df09df819..640e7cf560 100644
--- a/Tests/CompileDefinitions/compiletest.cpp
+++ b/Tests/CompileDefinitions/compiletest.cpp
@@ -7,29 +7,38 @@
#error Expect CMAKE_IS=Fun definition
#endif
-
-template<bool test>
+template <bool test>
struct CMakeStaticAssert;
-template<>
-struct CMakeStaticAssert<true> {};
+template <>
+struct CMakeStaticAssert<true>
+{
+};
static const char fun_string[] = CMAKE_IS_;
#ifndef NO_SPACES_IN_DEFINE_VALUES
static const char very_fun_string[] = CMAKE_IS_REALLY;
#endif
-enum {
- StringLiteralTest1 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_) == sizeof("Fun")>),
+enum
+{
+ StringLiteralTest1 =
+ sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_) == sizeof("Fun")>),
#ifndef NO_SPACES_IN_DEFINE_VALUES
- StringLiteralTest2 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_REALLY) == sizeof("Very Fun")>),
+ StringLiteralTest2 =
+ sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_REALLY) == sizeof("Very Fun")>),
#endif
#ifdef TEST_GENERATOR_EXPRESSIONS
- StringLiteralTest3 = sizeof(CMakeStaticAssert<sizeof(LETTER_LIST1) == sizeof("A,B,C,D")>),
- StringLiteralTest4 = sizeof(CMakeStaticAssert<sizeof(LETTER_LIST2) == sizeof("A,,B,,C,,D")>),
- StringLiteralTest5 = sizeof(CMakeStaticAssert<sizeof(LETTER_LIST3) == sizeof("A,-B,-C,-D")>),
- StringLiteralTest6 = sizeof(CMakeStaticAssert<sizeof(LETTER_LIST4) == sizeof("A-,-B-,-C-,-D")>),
- StringLiteralTest7 = sizeof(CMakeStaticAssert<sizeof(LETTER_LIST5) == sizeof("A-,B-,C-,D")>)
+ StringLiteralTest3 =
+ sizeof(CMakeStaticAssert<sizeof(LETTER_LIST1) == sizeof("A,B,C,D")>),
+ StringLiteralTest4 =
+ sizeof(CMakeStaticAssert<sizeof(LETTER_LIST2) == sizeof("A,,B,,C,,D")>),
+ StringLiteralTest5 =
+ sizeof(CMakeStaticAssert<sizeof(LETTER_LIST3) == sizeof("A,-B,-C,-D")>),
+ StringLiteralTest6 =
+ sizeof(CMakeStaticAssert<sizeof(LETTER_LIST4) == sizeof("A-,-B-,-C-,-D")>),
+ StringLiteralTest7 =
+ sizeof(CMakeStaticAssert<sizeof(LETTER_LIST5) == sizeof("A-,B-,C-,D")>)
#endif
};
@@ -70,35 +79,34 @@ enum {
#error Unexpected LINK_LANGUAGE_IS_C
#endif
-
// TEST_GENERATOR_EXPRESSIONS
#endif
#ifndef BUILD_IS_DEBUG
-# error "BUILD_IS_DEBUG not defined!"
+#error "BUILD_IS_DEBUG not defined!"
#endif
#ifndef BUILD_IS_NOT_DEBUG
-# error "BUILD_IS_NOT_DEBUG not defined!"
+#error "BUILD_IS_NOT_DEBUG not defined!"
#endif
// Check per-config definitions.
#ifdef TEST_CONFIG_DEBUG
-# if !BUILD_IS_DEBUG
-# error "BUILD_IS_DEBUG false with TEST_CONFIG_DEBUG!"
-# endif
-# if BUILD_IS_NOT_DEBUG
-# error "BUILD_IS_NOT_DEBUG true with TEST_CONFIG_DEBUG!"
-# endif
+#if !BUILD_IS_DEBUG
+#error "BUILD_IS_DEBUG false with TEST_CONFIG_DEBUG!"
+#endif
+#if BUILD_IS_NOT_DEBUG
+#error "BUILD_IS_NOT_DEBUG true with TEST_CONFIG_DEBUG!"
+#endif
#else
-# if BUILD_IS_DEBUG
-# error "BUILD_IS_DEBUG true without TEST_CONFIG_DEBUG!"
-# endif
-# if !BUILD_IS_NOT_DEBUG
-# error "BUILD_IS_NOT_DEBUG false without TEST_CONFIG_DEBUG!"
-# endif
+#if BUILD_IS_DEBUG
+#error "BUILD_IS_DEBUG true without TEST_CONFIG_DEBUG!"
+#endif
+#if !BUILD_IS_NOT_DEBUG
+#error "BUILD_IS_NOT_DEBUG false without TEST_CONFIG_DEBUG!"
+#endif
#endif
-int main(int argc, char **argv)
+int main(int argc, char** argv)
{
return 0;
}
diff --git a/Tests/CompileDefinitions/compiletest_mixed_c.c b/Tests/CompileDefinitions/compiletest_mixed_c.c
index a270b2b12e..5fbe45f92b 100644
--- a/Tests/CompileDefinitions/compiletest_mixed_c.c
+++ b/Tests/CompileDefinitions/compiletest_mixed_c.c
@@ -19,5 +19,4 @@
void someFunc(void)
{
-
}
diff --git a/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp b/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp
index ae6befc5f0..4eab0999ce 100644
--- a/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp
+++ b/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp
@@ -17,7 +17,7 @@
#error Expected C_EXECUTABLE_LINK_LANGUAGE_IS_C define
#endif
-int main(int argc, char **argv)
+int main(int argc, char** argv)
{
return 0;
}
diff --git a/Tests/CompileDefinitions/runtest.c b/Tests/CompileDefinitions/runtest.c
index c2d51aaf0c..7c28ab90e3 100644
--- a/Tests/CompileDefinitions/runtest.c
+++ b/Tests/CompileDefinitions/runtest.c
@@ -3,45 +3,40 @@
#include <string.h>
#ifndef BUILD_CONFIG_NAME
-# error "BUILD_CONFIG_NAME not defined!"
+#error "BUILD_CONFIG_NAME not defined!"
#endif
int main()
{
char build_config_name[] = BUILD_CONFIG_NAME;
char* c;
- for(c = build_config_name; *c; ++c)
- {
+ for (c = build_config_name; *c; ++c) {
*c = (char)tolower((int)*c);
- }
+ }
fprintf(stderr, "build_config_name=\"%s\"\n", build_config_name);
#ifdef TEST_CONFIG_DEBUG
- if(strcmp(build_config_name, "debug") != 0)
- {
+ if (strcmp(build_config_name, "debug") != 0) {
fprintf(stderr, "build_config_name is not \"debug\"\n");
return 1;
- }
+ }
#endif
#ifdef TEST_CONFIG_RELEASE
- if(strcmp(build_config_name, "release") != 0)
- {
+ if (strcmp(build_config_name, "release") != 0) {
fprintf(stderr, "build_config_name is not \"release\"\n");
return 1;
- }
+ }
#endif
#ifdef TEST_CONFIG_MINSIZEREL
- if(strcmp(build_config_name, "minsizerel") != 0)
- {
+ if (strcmp(build_config_name, "minsizerel") != 0) {
fprintf(stderr, "build_config_name is not \"minsizerel\"\n");
return 1;
- }
+ }
#endif
#ifdef TEST_CONFIG_RELWITHDEBINFO
- if(strcmp(build_config_name, "relwithdebinfo") != 0)
- {
+ if (strcmp(build_config_name, "relwithdebinfo") != 0) {
fprintf(stderr, "build_config_name is not \"relwithdebinfo\"\n");
return 1;
- }
+ }
#endif
return 0;
}
diff --git a/Tests/CompileDefinitions/target_prop/usetgt.c b/Tests/CompileDefinitions/target_prop/usetgt.c
index 6672a3e8f7..8408a908cc 100644
--- a/Tests/CompileDefinitions/target_prop/usetgt.c
+++ b/Tests/CompileDefinitions/target_prop/usetgt.c
@@ -1,10 +1,13 @@
#ifndef TGT_DEF
-# error TGT_DEF incorrectly not defined
+#error TGT_DEF incorrectly not defined
#endif
#ifndef TGT_TYPE_STATIC_LIBRARY
-# error TGT_TYPE_STATIC_LIBRARY incorrectly not defined
+#error TGT_TYPE_STATIC_LIBRARY incorrectly not defined
#endif
#ifdef TGT_TYPE_EXECUTABLE
-# error TGT_TYPE_EXECUTABLE incorrectly defined
+#error TGT_TYPE_EXECUTABLE incorrectly defined
#endif
-int main(void) { return 0; }
+int main(void)
+{
+ return 0;
+}