this repo has no description
1// Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
2#include <cmath>
3
4#include "gtest/gtest.h"
5
6#include "builtins.h"
7#include "test-utils.h"
8
9namespace py {
10namespace testing {
11
12using UnderValgrindModuleTest = RuntimeFixture;
13
14TEST_F(UnderValgrindModuleTest, UnderCallgrindDumpStatsWithNoneDoesNothing) {
15 HandleScope scope(thread_);
16 Object none(&scope, NoneType::object());
17 runBuiltin(FUNC(_valgrind, callgrind_dump_stats), none);
18}
19
20TEST_F(UnderValgrindModuleTest, UnderCallgrindDumpStatsWithStringDoesNothing) {
21 HandleScope scope(thread_);
22 Object string(&scope, runtime_->newStrFromCStr("service_load"));
23 runBuiltin(FUNC(_valgrind, callgrind_dump_stats), string);
24}
25
26TEST_F(UnderValgrindModuleTest, UnderCallgrindStartInstrumentationDoesNothing) {
27 ASSERT_FALSE(runFromCStr(runtime_, R"(
28import _valgrind
29_valgrind.callgrind_start_instrumentation()
30)")
31 .isError());
32}
33
34TEST_F(UnderValgrindModuleTest, UnderCallgrindStopInstrumentationDoesNothing) {
35 ASSERT_FALSE(runFromCStr(runtime_, R"(
36import _valgrind
37_valgrind.callgrind_stop_instrumentation()
38)")
39 .isError());
40}
41
42TEST_F(UnderValgrindModuleTest, UnderCallgrindZeroStatsDoesNothing) {
43 ASSERT_FALSE(runFromCStr(runtime_, R"(
44import _valgrind
45_valgrind.callgrind_zero_stats()
46)")
47 .isError());
48}
49
50} // namespace testing
51} // namespace py