mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-08 10:23:54 +00:00
b9f732c31f
As per t5494224, all of the license headers in osquery needed to be updated to reflect the correct open source header style.
38 lines
925 B
C++
38 lines
925 B
C++
/*
|
|
* Copyright (c) 2014, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
*/
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <osquery/core.h>
|
|
#include <osquery/sql.h>
|
|
|
|
namespace osquery {
|
|
|
|
class SQLTests : public testing::Test {};
|
|
|
|
TEST_F(SQLTests, test_simple_query_execution) {
|
|
auto sql = SQL("SELECT * FROM time");
|
|
EXPECT_TRUE(sql.ok());
|
|
EXPECT_EQ(sql.getMessageString(), getStringForSQLiteReturnCode(0));
|
|
EXPECT_EQ(sql.rows().size(), 1);
|
|
}
|
|
|
|
TEST_F(SQLTests, test_get_tables) {
|
|
auto tables = SQL::getTableNames();
|
|
EXPECT_TRUE(tables.size() > 0);
|
|
}
|
|
}
|
|
|
|
int main(int argc, char* argv[]) {
|
|
testing::InitGoogleTest(&argc, argv);
|
|
osquery::initOsquery(argc, argv);
|
|
return RUN_ALL_TESTS();
|
|
}
|