summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungjae Shin <yj99.shin@samsung.com>2020-08-03 09:10:38 +0900
committerYoungjae Shin <yj99.shin@samsung.com>2020-08-03 09:10:38 +0900
commit168418e10ed8efad724a0a2efc0c70b993694870 (patch)
treee2f75c2508df867af68a17ce27e61993ec556a6c
parent4ecb70100a0239d5c58c4a8559d53c5be8b3b055 (diff)
downloadlibslp-db-util-168418e10ed8efad724a0a2efc0c70b993694870.tar.gz
libslp-db-util-168418e10ed8efad724a0a2efc0c70b993694870.tar.bz2
libslp-db-util-168418e10ed8efad724a0a2efc0c70b993694870.zip
fix a test program bug
Change-Id: I8dc576511b72772ee5155ef62efb2a37abbac845
-rw-r--r--tests/db-util-gtest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/db-util-gtest.cpp b/tests/db-util-gtest.cpp
index 51abd5d..dd20e8b 100644
--- a/tests/db-util-gtest.cpp
+++ b/tests/db-util-gtest.cpp
@@ -151,13 +151,15 @@ TEST_F(DbUtil, db_util_open_n4)
chmod("test.db", 0000);
uid_t uid = geteuid();
- if (seteuid(1000) < 0)
- FAIL() << "errno = " << errno << std::endl;
+ if (geteuid() == 0)
+ if (seteuid(1000) < 0)
+ FAIL() << "errno = " << errno << std::endl;
rc = db_util_open(pszFilePath, &db, nOption);
- if (seteuid(uid) < 0)
+ if (uid == 0 && seteuid(uid) < 0)
FAIL() << "errno = " << errno << std::endl;
+
ASSERT_EQ(SQLITE_PERM, rc);
}