1eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes/*
2eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * Copyright (C) 2016 The Android Open Source Project
3eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes *
4eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * Licensed under the Apache License, Version 2.0 (the "License");
5eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * you may not use this file except in compliance with the License.
6eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * You may obtain a copy of the License at
7eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes *
8eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes *      http://www.apache.org/licenses/LICENSE-2.0
9eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes *
10eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * Unless required by applicable law or agreed to in writing, software
11eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * distributed under the License is distributed on an "AS IS" BASIS,
12eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * See the License for the specific language governing permissions and
14eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes * limitations under the License.
15eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes */
16eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes
17eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes#include <sys/quota.h>
18eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes
19eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes#include <gtest/gtest.h>
20eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes
21eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott HughesTEST(sys_quota, quotactl_dqblk) {
22eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes  // We don't even have kernels with CONFIG_QUOTA enabled right now.
23eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes  // This just tests that we can compile reasonable code.
24eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes  dqblk current;
25eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes  quotactl(QCMD(Q_GETQUOTA, USRQUOTA), "/", getuid(), reinterpret_cast<char*>(&current));
26eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes}
27eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes
28eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott HughesTEST(sys_quota, quotactl_dqinfo) {
29eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes  // We don't even have kernels with CONFIG_QUOTA enabled right now.
30eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes  // This just tests that we can compile reasonable code.
31eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes  dqinfo current;
32eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes  quotactl(QCMD(Q_GETINFO, USRQUOTA), "/", 0, reinterpret_cast<char*>(&current));
33eafad49bd6a0e6ca63ae0a5577d3ef7a45713107Elliott Hughes}
34