diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-25 21:57:52 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-25 21:57:52 +0300 |
commit | fbe2712705d464bf8488df249c36115e2c1f63f7 (patch) | |
tree | 274e728c719611769288afcb10f79549f6e11f8c /unittest | |
parent | 62903434eb009cb0bcd5003b0a45914bd4c09886 (diff) | |
parent | a19782522b1eac52d72f5e787b5d96f1fd1a2cb7 (diff) | |
download | mariadb-git-fbe2712705d464bf8488df249c36115e2c1f63f7.tar.gz |
Merge 10.4 into 10.5
The functional changes of commit 5836191c8f0658d5d75484766fdcc3d838b0a5c1
(MDEV-21168) are omitted due to MDEV-742 having addressed the issue.
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/mysys/my_atomic-t.c | 1 | ||||
-rw-r--r-- | unittest/mysys/my_vsnprintf-t.c | 38 |
2 files changed, 28 insertions, 11 deletions
diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c index 52bced7ce3b..1995a8e8950 100644 --- a/unittest/mysys/my_atomic-t.c +++ b/unittest/mysys/my_atomic-t.c @@ -14,6 +14,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ #include "thr_template.c" +#include "my_atomic.h" volatile uint32 b32; volatile int32 c32; diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c index 6ba0a42cf7e..872e88ddd7e 100644 --- a/unittest/mysys/my_vsnprintf-t.c +++ b/unittest/mysys/my_vsnprintf-t.c @@ -61,7 +61,7 @@ static void test_many(const char **res, const char *fmt, ...) int main(void) { - plan(39); + plan(43); test1("Constant string", "Constant string"); @@ -99,12 +99,28 @@ int main(void) test1("Width is ignored for strings <x> <y>", "Width is ignored for strings <%04s> <%5s>", "x", "y"); - test1("Precision works for strings <abcde>", + test1("Precision works for strings <ab...>", "Precision works for strings <%.5s>", "abcdef!"); - test1("Flag '`' (backtick) works: `abcd` `op``q` (mysql extension)", - "Flag '`' (backtick) works: %`s %`.4s (mysql extension)", - "abcd", "op`qrst"); + test1("Flag '`' (backtick) works: `abcd` `op``q...` (mysql extension)", + "Flag '`' (backtick) works: %`s %`.7s (mysql extension)", + "abcd", "op`qrstuuuuuuuuu"); + + test1("Flag '`' (backtick) works: `abcd` `.` (mysql extension)", + "Flag '`' (backtick) works: %`s %`.1s (mysql extension)", + "abcd", "op`qrstuuuuuuuuu"); + + test1("Flag '`' (backtick) works: `abcd` `...` (mysql extension)", + "Flag '`' (backtick) works: %`s %`.3s (mysql extension)", + "abcd", "op`qrstuuuuuuuuu"); + + test1("Flag '`' (backtick) works: `abcd` `op...` (mysql extension)", + "Flag '`' (backtick) works: %`s %`.5s (mysql extension)", + "abcd", "op`qrstuuuuuuuuu"); + + test1("Flag '`' (backtick) works: `abcd` `op``...` (mysql extension)", + "Flag '`' (backtick) works: %`s %`.6s (mysql extension)", + "abcd", "op`qrstuuuuuuuuu"); test1("Length modifiers work: 1 * -1 * 2 * 3", "Length modifiers work: %d * %ld * %lld * %zd", 1, -1L, 2LL, (size_t)3); @@ -125,13 +141,13 @@ int main(void) test1("Asterisk '*' as a width works: < 4>", "Asterisk '*' as a width works: <%*d>", 5, 4); - test1("Asterisk '*' as a precision works: <qwerty>", + test1("Asterisk '*' as a precision works: <qwe...>", "Asterisk '*' as a precision works: <%.*s>", 6, "qwertyuiop"); test1("Positional arguments for a width: < 4>", "Positional arguments for a width: <%1$*2$d>", 4, 5); - test1("Positional arguments for a precision: <qwerty>", + test1("Positional arguments for a precision: <qwe...>", "Positional arguments for a precision: <%1$.*2$s>", "qwertyuiop", 6); test1("Positional arguments and a width: <0000ab>", @@ -168,14 +184,14 @@ int main(void) test1("M with positional: 0 \"Internal error/check (Not system error)\"", "M with positional: %1$M", 0); - test1("M with width: 0 \"Internal error/ch", + test1("M with width: 0 \"Internal error...", "M with width: %.20M", 0); - test1("M with width positional: 0 \"Internal error/ch", + test1("M with width positional: 0 \"Internal error...", "M with width positional: %2$.*1$M", 20, 0); - test_w_len("M small buf: 0 \"In", + test_w_len("M small buf: 0 \"..", 19, "M small buf: %M", 0); - test_w_len("M small buf positional: 0 \"In", + test_w_len("M small buf positional: 0 \"..", 30, "M small buf positional: %1$M", 0); return exit_status(); |