mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
number, date & time parsing functions; psycString variant for isRoutingVar & getVarType
This commit is contained in:
parent
2324f8e6b4
commit
d40fa8c398
5 changed files with 113 additions and 33 deletions
|
@ -5,16 +5,16 @@
|
|||
#include <lib.h>
|
||||
|
||||
int main() {
|
||||
unless (psyc_getVarType(PSYC_C2ARG("_list"))) return 1;
|
||||
unless (psyc_getVarType(PSYC_C2ARG("_list_foo"))) return 2;
|
||||
unless (psyc_getVarType(PSYC_C2ARG("_color_red"))) return 3;
|
||||
if (psyc_getVarType(PSYC_C2ARG("_last"))) return 4;
|
||||
if (psyc_getVarType(PSYC_C2ARG("_lost_foo"))) return 5;
|
||||
if (psyc_getVarType(PSYC_C2ARG("_colorful"))) return 6;
|
||||
if (psyc_getVarType(PSYC_C2ARG("_foo"))) return 7;
|
||||
if (psyc_getVarType(PSYC_C2ARG("bar"))) return 8;
|
||||
if (psyc_getVarType(PSYC_C2ARG("______"))) return 9;
|
||||
if (psyc_getVarType(PSYC_C2ARG("_"))) return 10;
|
||||
unless (psyc_getVarType2(PSYC_C2ARG("_list"))) return 1;
|
||||
unless (psyc_getVarType2(PSYC_C2ARG("_list_foo"))) return 2;
|
||||
unless (psyc_getVarType2(PSYC_C2ARG("_color_red"))) return 3;
|
||||
if (psyc_getVarType2(PSYC_C2ARG("_last"))) return 4;
|
||||
if (psyc_getVarType2(PSYC_C2ARG("_lost_foo"))) return 5;
|
||||
if (psyc_getVarType2(PSYC_C2ARG("_colorful"))) return 6;
|
||||
if (psyc_getVarType2(PSYC_C2ARG("_foo"))) return 7;
|
||||
if (psyc_getVarType2(PSYC_C2ARG("bar"))) return 8;
|
||||
if (psyc_getVarType2(PSYC_C2ARG("______"))) return 9;
|
||||
if (psyc_getVarType2(PSYC_C2ARG("_"))) return 10;
|
||||
|
||||
puts("psyc_getVarType passed all tests.");
|
||||
return 0; // passed all tests
|
||||
|
|
|
@ -21,17 +21,17 @@ int main() {
|
|||
for (i = 0; i < sizeof(vars) / sizeof(*vars); i++)
|
||||
{
|
||||
printf(">> %s: %d %d\n", vars[i], sizeof(vars[i]), sizeof(*vars[i]));
|
||||
printf("%s: %d\n", vars[i], psyc_isRoutingVar(vars[i], strlen(vars[i])));
|
||||
printf("%s: %d\n", vars[i], psyc_isRoutingVar2(vars[i], strlen(vars[i])));
|
||||
}
|
||||
#else
|
||||
unless (psyc_isRoutingVar(PSYC_C2ARG("_source"))) return 1;
|
||||
unless (psyc_isRoutingVar(PSYC_C2ARG("_source_relay"))) return 2;
|
||||
if (psyc_isRoutingVar(PSYC_C2ARG("_source_foo"))) return 3;
|
||||
if (psyc_isRoutingVar(PSYC_C2ARG("_sourcherry"))) return 4;
|
||||
if (psyc_isRoutingVar(PSYC_C2ARG("_sour"))) return 5;
|
||||
if (psyc_isRoutingVar(PSYC_C2ARG("_foo"))) return 6;
|
||||
if (psyc_isRoutingVar(PSYC_C2ARG("bar"))) return 7;
|
||||
if (psyc_isRoutingVar(PSYC_C2ARG("_"))) return 8;
|
||||
unless (psyc_isRoutingVar2(PSYC_C2ARG("_source"))) return 1;
|
||||
unless (psyc_isRoutingVar2(PSYC_C2ARG("_source_relay"))) return 2;
|
||||
if (psyc_isRoutingVar2(PSYC_C2ARG("_source_foo"))) return 3;
|
||||
if (psyc_isRoutingVar2(PSYC_C2ARG("_sourcherry"))) return 4;
|
||||
if (psyc_isRoutingVar2(PSYC_C2ARG("_sour"))) return 5;
|
||||
if (psyc_isRoutingVar2(PSYC_C2ARG("_foo"))) return 6;
|
||||
if (psyc_isRoutingVar2(PSYC_C2ARG("bar"))) return 7;
|
||||
if (psyc_isRoutingVar2(PSYC_C2ARG("_"))) return 8;
|
||||
|
||||
puts("psyc_isRoutingVar passed all tests.");
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue