mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 23:34:34 +01:00
2662b59306
Docs/manual.texi: Added Innobase documentation configure.in: Incremented version include/my_base.h: Added option for Innobase myisam/mi_check.c: cleanup mysql-test/t/bdb.test: cleanup mysql-test/t/innobase.test: Extended with new tests from bdb.test mysql-test/t/merge.test: Added test of SHOW create mysys/my_init.c: Fix for UNIXWARE 7 scripts/mysql_install_db.sh: Always write how to start mysqld scripts/safe_mysqld.sh: Fixed type sql/ha_innobase.cc: Update to new version sql/ha_innobase.h: Update to new version sql/handler.h: Added 'update_table_comment()' and 'append_create_info()' sql/sql_delete.cc: Fixes for Innobase sql/sql_select.cc: Fixes for Innobase sql/sql_show.cc: Append create information (for MERGE tables) sql/sql_update.cc: Fixes for Innobase
57 lines
1 KiB
C
57 lines
1 KiB
C
/************************************************************************
|
|
The test module for dynamic array
|
|
|
|
(c) 1996 Innobase Oy
|
|
|
|
Created 2/5/1996 Heikki Tuuri
|
|
*************************************************************************/
|
|
|
|
#include "../dyn0dyn.h"
|
|
#include "sync0sync.h"
|
|
#include "mem0mem.h"
|
|
|
|
/****************************************************************
|
|
Basic test. */
|
|
|
|
void
|
|
test1(void)
|
|
/*=======*/
|
|
{
|
|
dyn_array_t dyn;
|
|
ulint i;
|
|
ulint* ulint_ptr;
|
|
|
|
printf("-------------------------------------------\n");
|
|
printf("TEST 1. Basic test\n");
|
|
|
|
dyn_array_create(&dyn);
|
|
|
|
for (i = 0; i < 1000; i++) {
|
|
ulint_ptr = dyn_array_push(&dyn, sizeof(ulint));
|
|
*ulint_ptr = i;
|
|
}
|
|
|
|
ut_a(dyn_array_get_n_elements(&dyn) == 1000);
|
|
|
|
for (i = 0; i < 1000; i++) {
|
|
ulint_ptr = dyn_array_get_nth_element(&dyn, i, sizeof(ulint));
|
|
ut_a(*ulint_ptr == i);
|
|
}
|
|
|
|
dyn_array_free(&dyn);
|
|
}
|
|
|
|
void
|
|
main(void)
|
|
{
|
|
sync_init();
|
|
mem_init();
|
|
|
|
test1();
|
|
|
|
ut_ad(sync_all_freed());
|
|
|
|
ut_ad(mem_all_freed());
|
|
|
|
printf("TEST SUCCESSFULLY COMPLETED!\n");
|
|
}
|