From 5a9ccbf6ec8bc28ef19452ef92253def9ef962f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Thu, 4 Sep 2008 23:12:25 +0000 Subject: [PATCH] Minor stylistic changes in several Boost Build unit tests. [SVN r48589] --- v2/test/conditionals.py | 2 +- v2/test/default_build.py | 4 ++-- v2/test/default_features.py | 2 +- v2/test/dependency_property.py | 7 ++----- v2/test/expansion.py | 8 ++++---- v2/test/make_rule.py | 2 +- v2/test/notfile.py | 6 +----- v2/test/regression.py | 2 -- v2/test/searched_lib.py | 4 ++-- v2/test/tag.py | 2 +- v2/test/unit_test.py | 12 ++++-------- v2/test/use_requirements.py | 2 +- v2/test/wrong_project.py | 4 +--- 13 files changed, 21 insertions(+), 36 deletions(-) diff --git a/v2/test/conditionals.py b/v2/test/conditionals.py index 918acd0f4..b1d78a540 100644 --- a/v2/test/conditionals.py +++ b/v2/test/conditionals.py @@ -15,7 +15,7 @@ t = BoostBuild.Tester() # define. t.write("a.cpp", """ #ifdef STATIC -int main() { return 0; } +int main() {} #endif """) diff --git a/v2/test/default_build.py b/v2/test/default_build.py index cc478c1c8..93d05ae3b 100644 --- a/v2/test/default_build.py +++ b/v2/test/default_build.py @@ -13,7 +13,7 @@ t = BoostBuild.Tester() t.write("jamroot.jam", "import gcc ;") t.write("jamfile.jam", "exe a : a.cpp : : debug release ;") -t.write("a.cpp", "int main() { return 0; }\n") +t.write("a.cpp", "int main() {}\n") t.run_build_system() t.expect_addition("bin/$toolset/debug/a.exe") @@ -71,7 +71,7 @@ t.write("a/a.cpp", """ __declspec(dllimport) #endif void foo(); -int main() { foo(); return 0; } +int main() { foo(); } """) t.write("b/jamfile.jam", """ diff --git a/v2/test/default_features.py b/v2/test/default_features.py index 887c52012..4d810caa7 100644 --- a/v2/test/default_features.py +++ b/v2/test/default_features.py @@ -27,7 +27,7 @@ t.write("hello.cpp", """ __declspec(dllimport) #endif void foo(); -int main() { foo(); return 1; } +int main() { foo(); } """) t.write("d/jamfile.jam", """ diff --git a/v2/test/dependency_property.py b/v2/test/dependency_property.py index 00af1ae55..2f19ba3f8 100644 --- a/v2/test/dependency_property.py +++ b/v2/test/dependency_property.py @@ -15,16 +15,13 @@ import string t = BoostBuild.Tester() -t.write("jamroot.jam", "") -t.write("jamfile.jam", """ +t.write("jamroot.jam", """ lib foo : foo.cpp ; exe hello : hello.cpp ; exe hello2 : hello.cpp : foo ; """) -t.write("hello.cpp", """ -int main() { return 0; } -""") +t.write("hello.cpp", "int main() {}\n") t.write("foo.cpp", """ #ifdef _WIN32 diff --git a/v2/test/expansion.py b/v2/test/expansion.py index 87d58934b..a9f665356 100644 --- a/v2/test/expansion.py +++ b/v2/test/expansion.py @@ -11,19 +11,19 @@ t = BoostBuild.Tester() t.write("a.cpp", """ #ifdef CF_IS_OFF -int main() { return 0; } +int main() {} #endif """) t.write("b.cpp", """ #ifdef CF_1 -int main() { return 0; } +int main() {} #endif """) t.write("c.cpp", """ #ifdef FOO -int main() { return 0; } +int main() {} #endif """) @@ -62,7 +62,7 @@ t.rm("bin") t.write("test.cpp", """ #include "header.h" -int main() { return 0; } +int main() {} """) t.write("jamfile.jam", """ diff --git a/v2/test/make_rule.py b/v2/test/make_rule.py index d00fea9e8..389200905 100644 --- a/v2/test/make_rule.py +++ b/v2/test/make_rule.py @@ -48,7 +48,7 @@ make hello1.cpp : hello.cpp : common.copy ; """) t.write("dir/hello.cpp", """ -int main() { return 1; } +int main() {} """) # Show only action names. diff --git a/v2/test/notfile.py b/v2/test/notfile.py index e5353536d..ba6509392 100644 --- a/v2/test/notfile.py +++ b/v2/test/notfile.py @@ -28,11 +28,7 @@ actions valgrind t.write("hello.cpp", """ #include -int main() -{ - std::cout << "Hello!\\n"; - return 1; -} +int main() { std::cout << "Hello!\\n"; } """) diff --git a/v2/test/regression.py b/v2/test/regression.py index 675bbe392..c65082810 100644 --- a/v2/test/regression.py +++ b/v2/test/regression.py @@ -79,8 +79,6 @@ int main( int ac, char * av[] ) std::ifstream ifs( av[ i ] ); std::cout << ifs.rdbuf(); } - - return 0; } """) diff --git a/v2/test/searched_lib.py b/v2/test/searched_lib.py index d88c79529..7f96b0a88 100644 --- a/v2/test/searched_lib.py +++ b/v2/test/searched_lib.py @@ -56,7 +56,7 @@ lib test_lib : : test_lib lib ; t.write("main.cpp", """ void helper(); -int main() { helper(); return 0; } +int main() { helper(); } """) t.write("helper.cpp", """ @@ -117,7 +117,7 @@ t.rm("bin/$toolset/debug/main.exe") t.write("jamfile.jam", "exe main : main.cpp d/d2//a ;") t.write("main.cpp", """ void foo(); -int main() { foo(); return 0; } +int main() { foo(); } """) t.write("d/d2/jamfile.jam", """ diff --git a/v2/test/tag.py b/v2/test/tag.py index bd7285bf8..aef31e808 100644 --- a/v2/test/tag.py +++ b/v2/test/tag.py @@ -30,7 +30,7 @@ rule tag ( name : type ? : property-set ) } exe a : a.cpp ; """) - t.write("version-1.32.0/a.cpp", "int main() { return 0; }\n") + t.write("version-1.32.0/a.cpp", "int main() {}\n") t.run_build_system(subdir="version-1.32.0") t.expect_addition("version-1.32.0/bin/$toolset/debug/a.exe") diff --git a/v2/test/unit_test.py b/v2/test/unit_test.py index dd484b206..94575ad31 100644 --- a/v2/test/unit_test.py +++ b/v2/test/unit_test.py @@ -1,8 +1,8 @@ #!/usr/bin/python -# Copyright 2003, 2004 Vladimir Prus -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) +# Copyright 2003, 2004 Vladimir Prus +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Test the unit_test rule. @@ -19,11 +19,7 @@ unit-test test : test.cpp : helper ; t.write("test.cpp", """ void helper(); -int main() -{ - helper(); - return 0; -} +int main() { helper(); } """) t.write("helper.cpp", """ diff --git a/v2/test/use_requirements.py b/v2/test/use_requirements.py index 6bc2d2381..a73c01f1f 100644 --- a/v2/test/use_requirements.py +++ b/v2/test/use_requirements.py @@ -74,7 +74,7 @@ foo() {} t.write("a.cpp", """ #ifdef FOO -int main() { return 0; } +int main() {} #endif """) diff --git a/v2/test/wrong_project.py b/v2/test/wrong_project.py index d358191c3..58d00d02e 100644 --- a/v2/test/wrong_project.py +++ b/v2/test/wrong_project.py @@ -13,9 +13,7 @@ import BoostBuild t = BoostBuild.Tester() -t.write("a.cpp", """ -int main() { return 0; } -""") +t.write("a.cpp", "int main() {}\n") t.write("jamroot.jam", """ using some_tool ;