summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b413c7f)
raw | patch | inline | side by side (parent: b413c7f)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 24 Oct 2014 18:25:17 +0000 (20:25 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 24 Oct 2014 18:25:17 +0000 (20:25 +0200) |
t/unit/core/data_test.c | patch | blob | history |
index 1129936f1184cea190907b4851be0ede710b60ad..a647e020bb7e63b8b34d3d95c6eee81201c00474 100644 (file)
--- a/t/unit/core/data_test.c
+++ b/t/unit/core/data_test.c
{ SDB_TYPE_DATETIME, { .datetime = 0 } },
err,
},
+ /* unsupported type-mismatches */
+ {
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ { SDB_TYPE_STRING, { .string = "20" } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ { SDB_TYPE_REGEX + 1, { .integer = 0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ { SDB_TYPE_STRING, { .string = "20.0" } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ { SDB_TYPE_BINARY, { .binary = { 4, (unsigned char *)"20.0" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ { SDB_TYPE_REGEX + 1, { .integer = 0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_STRING, { .string = "20" } },
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_STRING, { .string = "20" } },
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_STRING, { .string = "20" } },
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_STRING, { .string = "20" } },
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_STRING, { .string = "20" } },
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_STRING, { .string = "20" } },
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_STRING, { .string = "20" } },
+ { SDB_TYPE_REGEX + 1, { .integer = 0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ { SDB_TYPE_STRING, { .string = "20" } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ { SDB_TYPE_REGEX + 1, { .integer = 0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ { SDB_TYPE_STRING, { .string = "20" } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ { SDB_TYPE_STRING, { .string = "20" } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ { SDB_TYPE_STRING, { .string = "20" } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ { SDB_TYPE_STRING, { .string = "20" } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ { SDB_TYPE_REGEX + 1, { .integer = 0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ { SDB_TYPE_REGEX + 1, { .integer = 0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ { SDB_TYPE_INTEGER, { .integer = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ { SDB_TYPE_DECIMAL, { .decimal = 20.0 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ { SDB_TYPE_STRING, { .string = "20" } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ { SDB_TYPE_DATETIME, { .datetime = 20 } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ { SDB_TYPE_BINARY, { .binary = { 2, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ { SDB_TYPE_BINARY, { .binary = { 3, (unsigned char *)"20" } } },
+ err, err, err, err, err, err,
+ },
+ {
+ { SDB_TYPE_REGEX, { .re = { ".", empty_re } } },
+ { SDB_TYPE_REGEX + 1, { .integer = 0 } },
+ err, err, err, err, err, err,
+ },
};
size_t i;