4 Commits

Author SHA1 Message Date
Ian Wienand
e82bac0498 Detect blank variable in trueorfalse
As a follow-on to I8cefb58f49dcd2cb2def8a5071d0892af520e7f7, put in
some detection around missing variable-to-test arguments in
trueorfalse.

Correct a couple of places where we were passing in blank strings,
resulting in the default always being applied.

Add test-cases and enhance the documentation a little.

Depends-On: I8cefb58f49dcd2cb2def8a5071d0892af520e7f7
Change-Id: Icc0eb3808a2b6583828d8c47f0af4181e7e2c75a
2015-10-09 19:07:50 +11:00
Ian Wienand
165afa2377 Fix msg argument to assert_equal
I noticed this was taking an argument but not dealing with it.  In
general the functions were undocumented, so I added some terse usage.

Also, the intent of the test-case was to expand the values before
using them as the message; make sure this happens by using a temp
variable.

Change-Id: Ib317ad1e9dd2a5d2232b9c64541fe4a601a2b8da
2015-05-25 11:29:48 +10:00
Mahito OGURA
98f59aafaf Fix function and test for 'trueorfalse'.
The function's comment is written as follow, however the function accepts
other values (ex. "e", "t", "T", "f", "F", etc...).

---
Accepts as False: 0 no No NO false False FALSE
Accepts as True: 1 yes Yes YES true True TRUE
---

Moreover if testval mach True or False, the function exits without resetting
xtrace.

This patch fixes the issue and add test patterns.

Change-Id: Ie48a859476faff22a4dfef466516e2d7d62ef0c0
Closes-bug: #1453687
2015-05-11 18:23:07 +09:00
Ian Wienand
9b0ebc44f4 Move function.sh to test_functions.sh
run_tests.sh runs tests starting with test_*

The existing test_functions.sh is really testing true/false.  Move
that to test_truefalse.sh

Then move functions.sh to test_functions.sh.  This will ensure it is
run during unit testing from run-tests.sh

Change-Id: I959ac38c946da1fb47458b8c4f09157f74f0e644
2015-04-17 13:23:25 +10:00