summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'unittest')
-rw-r--r--unittest/mysys/my_vsnprintf-t.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c
index c83757782b6..4ef6c310c8f 100644
--- a/unittest/mysys/my_vsnprintf-t.c
+++ b/unittest/mysys/my_vsnprintf-t.c
@@ -31,7 +31,7 @@ void test1(const char *res, const char *fmt, ...)
int main(void)
{
- plan(50);
+ plan(54);
test1("Constant string",
"Constant string");
@@ -54,6 +54,10 @@ int main(void)
"Format specifier X %X", 11);
test1("Format specifier p 0x5",
"Format specifier p %p", 5);
+ test1("Format specifier f 3.141593",
+ "Format specifier f %f", 3.1415926);
+ test1("Format specifier g 3.1416",
+ "Format specifier g %g", 3.1415926);
test1("Flag '-' is ignored < 1>",
"Flag '-' is ignored <%-4d>", 1);
@@ -104,9 +108,12 @@ int main(void)
test1("Padding and %p <0x12> <0x034> <0x0000ab> < 0xcd>",
"Padding and %%p <%04p> <%05p> <%08p> <%8p>", 0x12, 0x34, 0xab, 0xcd);
-#if MYSQL_VERSION_ID > 60000
-#error %f/%g tests go here
-#endif
+ test1("F with a width (ignored) and precision: <12.34568>",
+ "F with a width (ignored) and precision: <%10.5f>", 12.3456789);
+ test1("G with a width (ignored) and precision: <12.35>",
+ "G with a width (ignored) and precision: <%10.5g>", 12.3456789);
+
+ diag("================================================================");
test1("Hello",
"Hello");