+++ /dev/null
-#!/bin/sh
-
-export TET_INSTALL_PATH=/home/deuk/repository/tetware/TETware # local tetware path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -c -p ./
-tcc -b -j $JOURNAL_RESULT -p ./
-grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
+++ /dev/null
-#!/bin/sh
-export TET_INSTALL_PATH=/mnt/nfs/tetware/TETware
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-
-export TET_ROOT=$TET_TARGET_PATH
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -e -j $JOURNAL_RESULT -p ./
-grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
+++ /dev/null
-# TET reserved codes
-0 "PASS"
-1 "FAIL"
-2 "UNRESOLVED"
-3 "NOTINUSE"
-4 "UNSUPPORTED"
-5 "UNTESTED"
-6 "UNINITIATED"
-7 "NORESULT"
-
-# Test suite additional codes
-33 "INSPECT"
+++ /dev/null
-all
- ^TEST
-##### Scenarios for TEST #####
-
-# Test scenario
-TEST
- :include:/unit/tslist
+++ /dev/null
-TET_OUTPUT_CAPTURE=False
-TET_BUILD_TOOL=make
+++ /dev/null
-TET_OUTPUT_CAPTURE=False
-TET_CLEAN_TOOL=make clean
+++ /dev/null
-TET_OUTPUT_CAPTURE=False
+++ /dev/null
-CC ?= gcc
-
-TARGETS = utc_ApplicationFW_db_util_close \
- utc_ApplicationFW_db_util_open \
- utc_ApplicationFW_db_util_open_with_options \
-
-PKGS = sqlite3 dlog db-util
-
-LDFLAGS = `pkg-config --libs $(PKGS)`
-LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
-LDFLAGS += -pthread
-
-CFLAGS = -I. `pkg-config --cflags $(PKGS)`
-CFLAGS += -I$(TET_ROOT)/inc/tet3
-CFLAGS += -Wall
-
-all: $(TARGETS)
-
-$(TARGETS): %: %.c
- $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(TARGETS)
+++ /dev/null
-#!/bin/sh
-
-TMPSTR=$0
-SCRIPT=${TMPSTR##*/}
-
-if [ $# -lt 2 ]; then
- echo "Usage) $SCRIPT module_name api_name"
- exit 1
-fi
-
-MODULE=$1
-API=$2
-TEMPLATE=utc_MODULE_API_func.c.in
-TESTCASE=utc_${MODULE}_${API}_func
-
-sed -e '
- s^@API@^'"$API"'^g
- s^@MODULE@^'"$MODULE"'^g
- ' $TEMPLATE > $TESTCASE.c
-
-if [ ! -e "$TESTCASE.c" ]; then
- echo "Failed"
- exit 1
-fi
-echo "Testcase file is $TESTCASE.c"
-echo "Done"
-echo "please put \"$TESTCASE\" as Target in Makefile"
-echo "please put \"/unit/$TESTCASE\" in tslist"
+++ /dev/null
-/unit/utc_ApplicationFW_db_util_close
-/unit/utc_ApplicationFW_db_util_open
-/unit/utc_ApplicationFW_db_util_open_with_options
+++ /dev/null
-/*
- * libslp-db-util
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Hakjoo Ko <hakjoo.ko@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <tet_api.h>
-#include <db-util.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ApplicationFW_db_util_close_func_01(void);
-static void utc_ApplicationFW_db_util_close_func_02(void);
-
-static sqlite3* db_hd = NULL;
-char* db_path = "/opt/test.db";
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_ApplicationFW_db_util_close_func_01, POSITIVE_TC_IDX },
- { utc_ApplicationFW_db_util_close_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 }
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of db_util_close()
- */
-static void utc_ApplicationFW_db_util_close_func_01(void)
-{
- int r = 0;
-
- r = db_util_open(db_path, &db_hd, 0);
- if (r != SQLITE_OK) {
- tet_infoline("db_util_close() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
-
- r = db_util_close(db_hd);
- if (r != SQLITE_OK) {
- tet_infoline("db_util_close() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- db_hd = NULL;
-
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init db_util_close()
- */
-static void utc_ApplicationFW_db_util_close_func_02(void)
-{
- int r = 0;
- sqlite3_stmt *db_stmt = NULL;
-
- db_hd = NULL;
-
- r = db_util_open(db_path, &db_hd, 0);
- if (r != SQLITE_OK) {
- tet_infoline("db_util_close() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- r = sqlite3_prepare(db_hd, "create table test(id int);", -1, &db_stmt, NULL);
- if (r != SQLITE_OK) {
- tet_infoline("db_util_close() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- r = db_util_close(db_hd);
- if (r == SQLITE_OK) {
- tet_infoline("db_util_close() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- tet_result(TET_PASS);
-}
-
+++ /dev/null
-/*
- * libslp-db-util
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Hakjoo Ko <hakjoo.ko@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <tet_api.h>
-#include <db-util.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ApplicationFW_db_util_open_func_01(void);
-static void utc_ApplicationFW_db_util_open_func_02(void);
-
-static sqlite3* db_hd = NULL;
-char* db_path = "test.db";
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_ApplicationFW_db_util_open_func_01, POSITIVE_TC_IDX },
- { utc_ApplicationFW_db_util_open_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 }
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
- db_util_close(db_hd);
-}
-
-/**
- * @brief Positive test case of db_util_open()
- */
-static void utc_ApplicationFW_db_util_open_func_01(void)
-{
- int r = 0;
-
- r = db_util_open(db_path, &db_hd, 0);
- if (r != SQLITE_OK) {
- tet_infoline("db_util_open() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
-
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init db_util_open()
- */
-static void utc_ApplicationFW_db_util_open_func_02(void)
-{
- int r = 0;
-
- r = db_util_open(NULL, &db_hd, 0);
- if (r == SQLITE_OK) {
- tet_infoline("db_util_open() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- r = db_util_open(db_path, NULL, 0);
- if (r == SQLITE_OK) {
- tet_infoline("db_util_open() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- tet_result(TET_PASS);
-}
+++ /dev/null
-/*
- * libslp-db-util
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Hakjoo Ko <hakjoo.ko@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <tet_api.h>
-#include <db-util.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ApplicationFW_db_util_open_with_options_func_01(void);
-static void utc_ApplicationFW_db_util_open_with_options_func_02(void);
-
-static sqlite3* db_hd = NULL;
-char* db_path = "/opt/test.db";
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_ApplicationFW_db_util_open_with_options_func_01, POSITIVE_TC_IDX },
- { utc_ApplicationFW_db_util_open_with_options_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 }
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
- db_util_close(db_hd);
-}
-
-/**
- * @brief Positive test case of db_util_open_with_options()
- */
-static void utc_ApplicationFW_db_util_open_with_options_func_01(void)
-{
- int r = 0;
-
- r = db_util_open_with_options(db_path, &db_hd, SQLITE_OPEN_READWRITE, NULL);
- if (r != SQLITE_OK) {
- tet_infoline("db_util_open() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
-
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init db_util_open_with_options()
- */
-static void utc_ApplicationFW_db_util_open_with_options_func_02(void)
-{
- int r = 0;
-
- r = db_util_open_with_options(NULL, &db_hd, SQLITE_OPEN_READWRITE, NULL);
- if (r == SQLITE_OK) {
- tet_infoline("db_util_open() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- r = db_util_open_with_options(db_path, NULL, SQLITE_OPEN_READWRITE, NULL);
- if (r == SQLITE_OK) {
- tet_infoline("db_util_open() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- r = db_util_open_with_options(db_path, &db_hd, 0, NULL);
- if (r == SQLITE_OK) {
- tet_infoline("db_util_open() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- unlink(db_path);
-
- r = db_util_open_with_options(db_path, &db_hd, SQLITE_OPEN_READONLY, NULL);
- if (r == SQLITE_OK) {
- tet_infoline("db_util_open() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
-
- tet_result(TET_PASS);
-}
-
-
+++ /dev/null
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_@MODULE@_@API@_func_01(void);
-static void utc_@MODULE@_@API@_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_@MODULE@_@API@_func_01, POSITIVE_TC_IDX },
- { utc_@MODULE@_@API@_func_02, NEGATIVE_TC_IDX },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of @API@()
- */
-static void utc_@MODULE@_@API@_func_01(void)
-{
- int r = 0;
-
- r = @API@(...);
-
- if (r<0) {
- tet_infoline("@API@() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init @API@()
- */
-static void utc_@MODULE@_@API@_func_02(void)
-{
- int r = 0;
-
- r = @API@(...);
-
- if (r>=0) {
- tet_infoline("@API@() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
}
#endif
- if(ucol_strength_value) {
+ if(ucol_strength_value == UCOL_PRIMARY) {
icu_symbol.icu_ucol_setStrength(ucol, ucol_strength_value);
if (U_FAILURE(status)) {
DB_UTIL_TRACE_ERROR("ucol_setStrength fail : %d \n", status);
UErrorCode status = U_ZERO_ERROR;
const char* locale = NULL;
+ if ( (!db_handle) || (!col_name) ) {
+ DB_UTIL_TRACE_ERROR("wrong input param");
+ return DB_UTIL_ERROR;
+ }
+
DB_UTIL_TRACE_DEBUG("db_util_create_collation start");
ret = __db_util_dl_load_icu();
DB_UTIL_RETV_IF(ret != DB_UTIL_OK, DB_UTIL_ERROR);
/* get current locale */
- icu_symbol.icu_uloc_setDefault((const char*)getenv("LC_COLLATE"), &status);
+ icu_symbol.icu_uloc_setDefault((const char*)getenv("LANG"), &status);
locale = icu_symbol.icu_uloc_getDefault();
if(locale == NULL) {
DB_UTIL_TRACE_WARNING("Fail to get current locale : %d", DB_UTIL_ERR_ENV);
#endif
default :
DB_UTIL_TRACE_WARNING("wrong collate input type");
+ ret = DB_UTIL_ERROR;
}
if(ret != DB_UTIL_OK)
{
if(5 - count > 0) {
DB_UTIL_TRACE_DEBUG("Busy Handler Called! : PID(%d) / CNT(%d)\n", getpid(), count+1);
- usleep((count+1)*100000);
+ struct timespec time = {
+ .tv_sec = 0,
+ .tv_nsec = (count+1) * 100 * 1000 * 1000
+ };
+ nanosleep(&time, NULL);
+
return 1;
} else {
DB_UTIL_TRACE_DEBUG("Busy Handler will be returned SQLITE_BUSY error : PID(%d) \n", getpid());
return DB_UTIL_ERROR;
}
+ if((geteuid() != 0) && (access(pszFilePath, R_OK))) {
+ if(errno == EACCES) {
+ DB_UTIL_TRACE_ERROR("file access permission error");
+ return SQLITE_PERM;
+ }
+ }
+
/* Open DB */
int rc = sqlite3_open(pszFilePath, ppDB);
if (SQLITE_OK != rc) {