// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 #include "Thread.h" #include using namespace Aws::IoTFleetWise::Platform::Linux; void workerFunction( void *data ) { static_cast( data ); // Ignore unused parameter std::cout << "Hello from IoTFleetWise"; usleep( 500000 ); } TEST( ThreadTest, ThreadCPUUsageInfo ) { Thread thread; ASSERT_TRUE( !thread.isValid() ); ASSERT_TRUE( thread.create( workerFunction, this ) ); ASSERT_TRUE( thread.isActive() ); ASSERT_TRUE( thread.isValid() ); thread.release(); ASSERT_TRUE( !thread.isValid() ); ASSERT_TRUE( !thread.isActive() ); }