<commit_before>#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "..\..\src\stkdata\stkdata.h"
#include "..\..\src\stkdata\stkdataapi.h"

/*
SmallTable
ECreateTableSmallTablee[u(ID:Int) Max=1 𐶐邱Ƃł
Eő僌R[ho^\=1SmallTableɑ΂16383̘AꂽR[hInsertRecord1R[ĥݒǉ
EBigTable("ID"J = 1)Ɏw肵GetRecordiR[hwjsNULLԂ
ESmallTable("ID"J = 0)Ɏw肵bNGetRecordiR[hwjsRecordDataԂBbNŎsꍇNULLԂ
EGetNumOfRecords("SmallTable")Ŏ擾R[h1ƂȂ
EGetMaxNumOfRecords("SmallTable")Ŏ擾R[h1ƂȂ
EGetNumOfRecords("BigTable")Ŏ擾R[h-1ƂȂ
EGetMaxNumOfRecords("BigTable")Ŏ擾R[h-1ƂȂ
EDeleteRecord(_T("SmallTable"))CGetNumOfRecords(_T("SmallTable"))0ԋp
EDeleteTable(_T("SmallTable"))0ԋp
*/
int SmallTable()
{
	// CreateTableSmallTablee[u(ID:Int) Max=1 𐶐邱Ƃł
	printf("CreateTableSmallTablee[u(ID:Int) Max=1 𐶐邱Ƃł");
	ColumnDefInt ColDefId(_T("ID"));
	TableDef TabDefPerson(_T("SmallTable"), 1);
	TabDefPerson.AddColumnDef(&ColDefId);
	if (CreateTable(&TabDefPerson) != 0) {
		printf("...[NG]\r\n");
		return -1;
	}
	if (GetMaxNumOfRecords(_T("SmallTable")) != 1) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// ő僌R[ho^\=1SmallTableɑ΂16383̘AꂽR[hInsertRecord1R[ĥݒǉ
	{
		printf("ő僌R[ho^\=1SmallTableɑ΂16383̘AꂽR[hInsertRecord1R[ĥݒǉ");
		ColumnData *ColDat[4];
		RecordData *TopRecDat;
		RecordData *PrvRecDat;
		RecordData *CurRecDat;
		for (int i = 0; i < 16383; i++) {
			ColDat[0] = new ColumnDataInt(_T("ID"), i);
			CurRecDat = new RecordData(_T("SmallTable"), ColDat, 1);
			if (i == 0) {
				TopRecDat = CurRecDat;
			}
			if (i >= 1) {
				PrvRecDat->SetNextRecord(CurRecDat);
			}
			PrvRecDat = CurRecDat;
		}
		LockTable(_T("SmallTable"), 2);
		InsertRecord(TopRecDat);
		UnlockTable(_T("SmallTable"));
		delete TopRecDat;
		if (GetMaxNumOfRecords(_T("SmallTable")) != 1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// BigTable("ID"J = 1)Ɏw肵GetRecordiR[hwjsNULLԂ
	{
		printf("BigTable(\"ID\"J = 1)Ɏw肵GetRecordiR[hwjsNULLԂ");
		ColumnData *ColDatTake[1];
		ColDatTake[0] = new ColumnDataInt(_T("ID"), 1);
		RecordData RecDatTake(_T("BigTable"), ColDatTake, 1);
		RecordData *RecDatGet;
		LockTable(_T("SmallTable"), 1);
		RecDatGet = GetRecord(&RecDatTake);
		UnlockTable(_T("SmallTable"));
		if (RecDatGet != NULL) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// SmallTable("ID"J = 0)Ɏw肵bNGetRecordiR[hwjsRecordDataԂBbNŎsꍇNULLԂ
	{
		printf("SmallTable(\"ID\"J = 0)Ɏw肵bNGetRecordiR[hwjsRecordDataԂBbNŎsꍇNULLԂ");
		ColumnData *ColDatTake[1];
		ColDatTake[0] = new ColumnDataInt(_T("ID"), 0);
		RecordData RecDatTake(_T("SmallTable"), ColDatTake, 1);
		RecordData *RecDatGet;
		LockTable(_T("SmallTable"), 1);
		RecDatGet = GetRecord(&RecDatTake);
		UnlockTable(_T("SmallTable"));
		if (RecDatGet == NULL) {
			printf("...[NG]\r\n");
			return -1;
		}
		delete RecDatGet;
		RecDatGet = GetRecord(&RecDatTake);
		if (RecDatGet != NULL) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// GetNumOfRecords("SmallTable")Ŏ擾R[h1ƂȂ
	{
		printf("GetNumOfRecords(\"SmallTable\")Ŏ擾R[h1ƂȂ");
		if (GetNumOfRecords(_T("SmallTable")) != 1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// GetMaxNumOfRecords("SmallTable")Ŏ擾R[h1ƂȂ
	{
		printf("GetMaxNumOfRecords(\"SmallTable\")Ŏ擾R[h1ƂȂ");
		if (GetMaxNumOfRecords(_T("SmallTable")) != 1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// GetNumOfRecords("BigTable")Ŏ擾R[h-1ƂȂ
	{
		printf("GetNumOfRecords(\"BigTable\")Ŏ擾R[h-1ƂȂ");
		if (GetNumOfRecords(_T("BigTable")) != -1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// GetMaxNumOfRecords("BigTable")Ŏ擾R[h-1ƂȂ
	{
		printf("GetMaxNumOfRecords(\"BigTable\")Ŏ擾R[h-1ƂȂ");
		if (GetMaxNumOfRecords(_T("BigTable")) != -1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// DeleteRecord(_T("SmallTable"))CGetNumOfRecords(_T("SmallTable"))0ԋp
	{
		printf("DeleteRecord(_T(\"SmallTable\"))CGetNumOfRecords(_T(\"SmallTable\"))0ԋp");
		LockTable(_T("SmallTable"), LOCK_EXCLUSIVE);
		DeleteRecord(_T("SmallTable"));
		UnlockTable(_T("SmallTable"));
		if (GetNumOfRecords(_T("SmallTable")) != 0) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// DeleteTable(_T("SmallTable"))0ԋp
	{
		printf("DeleteTable(_T(\"SmallTable\"))0ԋp");
		if (DeleteTable(_T("SmallTable")) != 0) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}
	return 0;
}
<commit_msg>#70 : Test code has been added.<commit_after>#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "..\..\src\stkdata\stkdata.h"
#include "..\..\src\stkdata\stkdataapi.h"

/*
SmallTable
ECreateTableSmallTablee[u(ID:Int) Max=1 𐶐邱Ƃł
Eő僌R[ho^\=1SmallTableɑ΂16383̘AꂽR[hInsertRecord1R[ĥݒǉ
EBigTable("ID"J = 1)Ɏw肵GetRecordiR[hwjsNULLԂ
ESmallTable("ID"J = 0)Ɏw肵bNGetRecordiR[hwjsRecordDataԂBbNŎsꍇNULLԂ
EGetNumOfRecords("SmallTable")Ŏ擾R[h1ƂȂ
EGetMaxNumOfRecords("SmallTable")Ŏ擾R[h1ƂȂ
EGetNumOfRecords("BigTable")Ŏ擾R[h-1ƂȂ
EGetMaxNumOfRecords("BigTable")Ŏ擾R[h-1ƂȂ
EDeleteRecord(_T("SmallTable"))CGetNumOfRecords(_T("SmallTable"))0ԋp
EDeleteTable(_T("SmallTable"))0ԋp
*/
int SmallTable()
{
	// CreateTableSmallTablee[u(ID:Int) Max=1 𐶐邱Ƃł
	printf("CreateTableSmallTablee[u(ID:Int) Max=1 𐶐邱Ƃł");
	ColumnDefInt ColDefId(_T("ID"));
	TableDef TabDefPerson(_T("SmallTable"), 1);
	TabDefPerson.AddColumnDef(&ColDefId);
	if (CreateTable(&TabDefPerson) != 0) {
		printf("...[NG]\r\n");
		return -1;
	}
	if (GetMaxNumOfRecords(_T("SmallTable")) != 1) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// ő僌R[ho^\=1SmallTableɑ΂16383̘AꂽR[hInsertRecord1R[ĥݒǉ
	{
		printf("ő僌R[ho^\=1SmallTableɑ΂16383̘AꂽR[hInsertRecord1R[ĥݒǉ");
		ColumnData *ColDat[4];
		RecordData *TopRecDat;
		RecordData *PrvRecDat;
		RecordData *CurRecDat;
		for (int i = 0; i < 16383; i++) {
			ColDat[0] = new ColumnDataInt(_T("ID"), i);
			CurRecDat = new RecordData(_T("SmallTable"), ColDat, 1);
			if (i == 0) {
				TopRecDat = CurRecDat;
			}
			if (i >= 1) {
				PrvRecDat->SetNextRecord(CurRecDat);
			}
			PrvRecDat = CurRecDat;
		}
		LockTable(_T("SmallTable"), 2);
		InsertRecord(TopRecDat);
		UnlockTable(_T("SmallTable"));
		delete TopRecDat;
		if (GetMaxNumOfRecords(_T("SmallTable")) != 1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// BigTable("ID"J = 1)Ɏw肵GetRecordiR[hwjsNULLԂ
	{
		printf("BigTable(\"ID\"J = 1)Ɏw肵GetRecordiR[hwjsNULLԂ");
		ColumnData *ColDatTake[1];
		ColDatTake[0] = new ColumnDataInt(_T("ID"), 1);
		RecordData RecDatTake(_T("BigTable"), ColDatTake, 1);
		RecordData *RecDatGet;
		LockTable(_T("SmallTable"), 1);
		RecDatGet = GetRecord(&RecDatTake);
		UnlockTable(_T("SmallTable"));
		if (RecDatGet != NULL) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// SmallTable("ID"J = 0)Ɏw肵bNGetRecordiR[hwjsRecordDataԂBbNŎsꍇNULLԂ
	{
		printf("SmallTable(\"ID\"J = 0)Ɏw肵bNGetRecordiR[hwjsRecordDataԂBbNŎsꍇNULLԂ");
		ColumnData *ColDatTake[1];
		ColDatTake[0] = new ColumnDataInt(_T("ID"), 0);
		RecordData RecDatTake(_T("SmallTable"), ColDatTake, 1);
		RecordData *RecDatGet;
		LockTable(_T("SmallTable"), 1);
		RecDatGet = GetRecord(&RecDatTake);
		UnlockTable(_T("SmallTable"));
		if (RecDatGet == NULL) {
			printf("...[NG]\r\n");
			return -1;
		}
		delete RecDatGet;
		RecDatGet = GetRecord(&RecDatTake);
		if (RecDatGet != NULL) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// GetNumOfRecords("SmallTable")Ŏ擾R[h1ƂȂ
	{
		printf("GetNumOfRecords(\"SmallTable\")Ŏ擾R[h1ƂȂ");
		if (GetNumOfRecords(_T("SmallTable")) != 1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// GetMaxNumOfRecords("SmallTable")Ŏ擾R[h1ƂȂ
	{
		printf("GetMaxNumOfRecords(\"SmallTable\")Ŏ擾R[h1ƂȂ");
		if (GetMaxNumOfRecords(_T("SmallTable")) != 1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// GetNumOfRecords("BigTable")Ŏ擾R[h-1ƂȂ
	{
		printf("GetNumOfRecords(\"BigTable\")Ŏ擾R[h-1ƂȂ");
		if (GetNumOfRecords(_T("BigTable")) != -1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// GetMaxNumOfRecords("BigTable")Ŏ擾R[h-1ƂȂ
	{
		printf("GetMaxNumOfRecords(\"BigTable\")Ŏ擾R[h-1ƂȂ");
		if (GetMaxNumOfRecords(_T("BigTable")) != -1) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// DeleteRecord(_T("SmallTable"))CGetNumOfRecords(_T("SmallTable"))0ԋp
	{
		printf("DeleteRecord(_T(\"SmallTable\"))CGetNumOfRecords(_T(\"SmallTable\"))0ԋp");
		LockTable(_T("SmallTable"), LOCK_EXCLUSIVE);
		DeleteRecord(_T("SmallTable"));
		UnlockTable(_T("SmallTable"));
		if (GetNumOfRecords(_T("SmallTable")) != 0) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// CreateTableSmallTablee[u2(ID:Int) Max=100 𐶐邱Ƃł
	printf("CreateTableSmallTablee[u2(ID:Int) Max=100 𐶐邱Ƃł");
	ColumnDefInt ColDefId2(_T("ID"));
	TableDef TabDefPerson2(_T("SmallTable2"), 100);
	TabDefPerson2.AddColumnDef(&ColDefId2);
	if (CreateTable(&TabDefPerson2) != 0) {
		printf("...[NG]\r\n");
		return -1;
	}
	if (GetMaxNumOfRecords(_T("SmallTable2")) != 100) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// Rename table name (UnexistTable ---> RenamedTable)
	printf("Rename table name (UnexistTable ---> RenamedTable)  Does the API return -1?");
	if (RenameTable(_T("UnexistTable"), _T("RenamedTable")) != -1) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// Rename table name (SmallTable ---> SmallTable2)
	printf("Rename table name (SmallTable ---> SmallTable2)  Does the API return -1?");
	if (RenameTable(_T("SmallTable"), _T("SmallTable2")) != -1) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// Rename table name (SmallTable2 ---> SmallTable3)
	printf("Rename table name (SmallTable2 ---> SmallTable3)  Does the API return 0?");
	if (RenameTable(_T("SmallTable2"), _T("SmallTable3")) != 0) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// Check that SmallTable2 is renamed as SmallTable3.
	printf("Check that SmallTable2 is renamed as SmallTable3.");
	TCHAR TblNames[MAX_TABLE_NUMBER][TABLE_NAME_SIZE];
	int TblCnt = GetTableName(TblNames);
	if (lstrcmp(TblNames[0], _T("SmallTable")) != 0 && lstrcmp(TblNames[1], _T("SmallTable2")) != 0) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// Rename table name (SmallTable3 ---> SmallTable4)
	printf("Rename table name (SmallTable3 ---> SmallTable4)  Does the API return 0?");
	if (RenameTable(_T("SmallTable3"), _T("SmallTable4")) != 0) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// Rename table name (SmallTable ---> SmallTable5)
	printf("Rename table name (SmallTable ---> SmallTable5)  Does the API return 0?");
	if (RenameTable(_T("SmallTable"), _T("SmallTable5")) != 0) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// Check that SmallTable is renamed as SmallTable5.
	printf("Check that SmallTable is renamed as SmallTable5.");
	TblCnt = GetTableName(TblNames);
	if (lstrcmp(TblNames[0], _T("SmallTable5")) != 0 && lstrcmp(TblNames[1], _T("SmallTable4")) != 0) {
		printf("...[NG]\r\n");
		return -1;
	}
	printf("...[OK]\r\n");

	// DeleteTable(_T("SmallTable4"))0ԋp
	{
		printf("DeleteTable(_T(\"SmallTable4\"))0ԋp");
		if (DeleteTable(_T("SmallTable4")) != 0) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}

	// DeleteTable(_T("SmallTable5"))0ԋp
	{
		printf("DeleteTable(_T(\"SmallTable5\"))0ԋp");
		if (DeleteTable(_T("SmallTable5")) != 0) {
			printf("...[NG]\r\n");
			return -1;
		}
		printf("...[OK]\r\n");
	}
	return 0;
}

{'fraction_non_alphanumeric': 0.2244179053183263, 'fraction_numerical': 0.023541541369533465, 'mean_word_length': 4.434173669467787, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '949039', 'n_tokens_mistral': 5655, 'n_tokens_neox': 5181, 'n_words': 667}