mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-05-06 17:21:13 +08:00
36 lines
970 B
C++
36 lines
970 B
C++
#include <gtest/gtest.h> // for Test, SuiteApiResolver, TestInfo (ptr only), TEST, TestFactoryImpl
|
|
#include <memory> // for shared_ptr, allocator, make_shared, __shared_ptr_access
|
|
|
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
|
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
|
|
|
|
using namespace ftxui;
|
|
|
|
namespace {
|
|
Component Make() {
|
|
return std::make_shared<ComponentBase>();
|
|
}
|
|
} // namespace
|
|
|
|
// Regression test for:
|
|
// https://github.com/ArthurSonzogni/FTXUI/issues/115
|
|
TEST(ContainerTest, DeleteParentFirst) {
|
|
auto parent = Make();
|
|
auto child = Make();
|
|
parent->Add(child);
|
|
parent.reset();
|
|
child.reset();
|
|
}
|
|
|
|
TEST(ContainerTest, DeleteChildFirst) {
|
|
auto parent = Make();
|
|
auto child = Make();
|
|
parent->Add(child);
|
|
child.reset();
|
|
parent.reset();
|
|
}
|
|
|
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
// the LICENSE file.
|