From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q7NOY-0003bm-0t for garchives@archives.gentoo.org; Wed, 06 Apr 2011 07:43:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 415541C02E; Wed, 6 Apr 2011 07:43:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0D3231C02E for ; Wed, 6 Apr 2011 07:43:09 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8BE441B40E9 for ; Wed, 6 Apr 2011 07:43:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B86D58006D for ; Wed, 6 Apr 2011 07:43:08 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: <951bb1b72491976c03939ac186c9cfe4a236fb84.betelgeuse@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: src/core/, src/core/tests/ X-VCS-Repository: proj/libbash X-VCS-Files: src/core/interpreter.h src/core/tests/interpreter_test.cpp X-VCS-Directories: src/core/ src/core/tests/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 951bb1b72491976c03939ac186c9cfe4a236fb84 Date: Wed, 6 Apr 2011 07:43:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 096ca51877ee9074aac4d090c478ffde commit: 951bb1b72491976c03939ac186c9cfe4a236fb84 Author: Mu Qiao gentoo org> AuthorDate: Tue Apr 5 11:38:06 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Tue Apr 5 11:38:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D951bb1b7 Rename is_null to is_unset_or_null is_null method will always check if the variable is unset. So change the name to a more proper one. --- src/core/interpreter.h | 4 ++-- src/core/tests/interpreter_test.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/interpreter.h b/src/core/interpreter.h index c0cc12d..ab6b9e8 100644 --- a/src/core/interpreter.h +++ b/src/core/interpreter.h @@ -366,7 +366,7 @@ public: /// if the variable is undefined /// \param variable name /// \return whether the value of the variable is null - bool is_null(const std::string& name) + bool is_unset_or_null(const std::string& name) { std::shared_ptr value =3D members.resolve(name); if(value) @@ -422,7 +422,7 @@ public: const std::string do_default_expansion(const std::string& name, const std::string& value) { - return (is_null(name)? value : resolve(name)); + return (is_unset_or_null(name)? value : resolve(name)); } }; #endif diff --git a/src/core/tests/interpreter_test.cpp b/src/core/tests/interpr= eter_test.cpp index 6f8d0c4..2d46e62 100644 --- a/src/core/tests/interpreter_test.cpp +++ b/src/core/tests/interpreter_test.cpp @@ -44,13 +44,13 @@ TEST(interpreter, define_resolve_string) EXPECT_STREQ("", walker.resolve("undefined").c_str()); } =20 -TEST(interpreter, is_null) +TEST(interpreter, is_unset_or_null) { interpreter walker; walker.define("foo", "hello"); - EXPECT_FALSE(walker.is_null("foo")); + EXPECT_FALSE(walker.is_unset_or_null("foo")); walker.define("foo", "hello", false, true); - EXPECT_TRUE(walker.is_null("foo")); + EXPECT_TRUE(walker.is_unset_or_null("foo")); } =20 TEST(interpreter, is_unset)