Skip to content

Commit

Permalink
More tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Cole committed Jul 20, 2023
1 parent cc9bb4e commit 0285a38
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
19 changes: 19 additions & 0 deletions YSI_Core/y_core/y_cell_tests.inc
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,29 @@ static stock y_cell_CountBits_v4(GLOBAL_TAG_TYPES:data)
ASSERT(Cell_HasZeroByte(0xFF00FFFF));
ASSERT(Cell_HasZeroByte(0x0000FFFF));
ASSERT(Cell_HasZeroByte(0x00FFFFFF));
ASSERT(!Cell_HasZeroByte(0x20202020));
ASSERT(!Cell_HasZeroByte(0x55555555));
ASSERT(!Cell_HasZeroByte(0xFFFFFFFF));
ASSERT(!Cell_HasZeroByte(0x01010101));
ASSERT(!Cell_HasZeroByte(0x01FFFFFF));
ASSERT(!Cell_HasZeroByte(0xF00FFFFF));
}

@test(.group = "y_cell") y_cell_HasSpaceByte()
{
ASSERT(Cell_HasSpaceByte(0x20202020));
ASSERT(Cell_HasSpaceByte(0x20802020));
ASSERT(Cell_HasSpaceByte(0xFFFFFF20));
ASSERT(Cell_HasSpaceByte(0xFFFF20FF));
ASSERT(Cell_HasSpaceByte(0xFFFF2020));
ASSERT(Cell_HasSpaceByte(0xFF20FFFF));
ASSERT(Cell_HasSpaceByte(0x2020FFFF));
ASSERT(Cell_HasSpaceByte(0x20FFFFFF));
ASSERT(!Cell_HasSpaceByte(0x00000000));
ASSERT(!Cell_HasSpaceByte(0x55555555));
ASSERT(!Cell_HasSpaceByte(0xFFFFFFFF));
ASSERT(!Cell_HasSpaceByte(0x01010101));
ASSERT(!Cell_HasSpaceByte(0x01FFFFFF));
ASSERT(!Cell_HasSpaceByte(0xF20FFFFF));
}

30 changes: 30 additions & 0 deletions YSI_Extra/y_inline_mysql.inc
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,33 @@ stock ORM_SaveInline(ORM:id, Func:cb<>)
return ret;
}

#if !defined YSI_TESTS
#endinput
#endif

#define MySQL_Connect mysql_connect
#define MySQL_Close mysql_close
#define MySQL_Log mysql_log

public OnQueryError(errorid, const error[], const callback[], const query[], MySQL:handle)
{
printf("ERROR: %d, %d (%s)", _:handle, errorid, error);
printf(" %s, %s", callback, query);
}

@test(.group = "y_inline_mysql") MySQL_PQueryInline()
{
MySQL_Log(ERROR | WARNING | INFO | DEBUG);
new MySQL:sql = MySQL_Connect("127.0.0.1", "root", "", "y_inline_mysql");
ASSERT_NE(sql, MYSQL_INVALID_HANDLE);
if (sql)
{
inline const MySQLResult()
{

}
MySQL_PQueryInline(sql, using inline MySQLResult, "CREATE TABLE IF NOT EXIST table1 ( Row int );");
MySQL_Close(sql);
}
}

0 comments on commit 0285a38

Please sign in to comment.