4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hakjoo Ko <hakjoo.ko@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
25 static void startup(void);
26 static void cleanup(void);
28 void (*tet_startup)(void) = startup;
29 void (*tet_cleanup)(void) = cleanup;
31 static void utc_ApplicationFW_db_util_open_with_options_func_01(void);
32 static void utc_ApplicationFW_db_util_open_with_options_func_02(void);
34 static sqlite3* db_hd = NULL;
35 char* db_path = "/opt/test.db";
38 POSITIVE_TC_IDX = 0x01,
42 struct tet_testlist tet_testlist[] = {
43 { utc_ApplicationFW_db_util_open_with_options_func_01, POSITIVE_TC_IDX },
44 { utc_ApplicationFW_db_util_open_with_options_func_02, NEGATIVE_TC_IDX },
48 static void startup(void)
52 static void cleanup(void)
58 * @brief Positive test case of db_util_open_with_options()
60 static void utc_ApplicationFW_db_util_open_with_options_func_01(void)
64 r = db_util_open_with_options(db_path, &db_hd, SQLITE_OPEN_READWRITE, NULL);
66 tet_infoline("db_util_open() failed in positive test case");
75 * @brief Negative test case of ug_init db_util_open_with_options()
77 static void utc_ApplicationFW_db_util_open_with_options_func_02(void)
81 r = db_util_open_with_options(NULL, &db_hd, SQLITE_OPEN_READWRITE, NULL);
83 tet_infoline("db_util_open() failed in negative test case");
88 r = db_util_open_with_options(db_path, NULL, SQLITE_OPEN_READWRITE, NULL);
90 tet_infoline("db_util_open() failed in negative test case");
95 r = db_util_open_with_options(db_path, &db_hd, 0, NULL);
97 tet_infoline("db_util_open() failed in negative test case");
104 r = db_util_open_with_options(db_path, &db_hd, SQLITE_OPEN_READONLY, NULL);
105 if (r == SQLITE_OK) {
106 tet_infoline("db_util_open() failed in negative test case");
107 tet_result(TET_FAIL);
111 tet_result(TET_PASS);