blob: 5154ea4c8fe10ec7d950eca42e1bd6e11a4651ea [file] [log] [blame]
Narumol Prangnawarat1c52a382022-01-13 11:47:35 +00001//
2// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include <reference/RefBackend.hpp>
7#include <reference/RefTensorHandleFactory.hpp>
8
9#include <doctest/doctest.h>
10
11using namespace armnn;
12
13TEST_SUITE("RefBackendTests")
14{
15TEST_CASE("RefRegisterTensorHandleFactoriesMatchingImportFactoryId")
16{
17 auto refBackend = std::make_unique<RefBackend>();
18 TensorHandleFactoryRegistry registry;
19 refBackend->RegisterTensorHandleFactories(registry);
20
21 // When calling RegisterTensorHandleFactories, CopyAndImportFactoryPair is registered
22 // Get matching import factory id correctly
23 CHECK((registry.GetMatchingImportFactoryId(RefTensorHandleFactory::GetIdStatic()) ==
24 RefTensorHandleFactory::GetIdStatic()));
25}
26
27TEST_CASE("RefCreateWorkloadFactoryMatchingImportFactoryId")
28{
29 auto refBackend = std::make_unique<RefBackend>();
30 TensorHandleFactoryRegistry registry;
31 refBackend->CreateWorkloadFactory(registry);
32
33 // When calling CreateWorkloadFactory, CopyAndImportFactoryPair is registered
34 // Get matching import factory id correctly
35 CHECK((registry.GetMatchingImportFactoryId(RefTensorHandleFactory::GetIdStatic()) ==
36 RefTensorHandleFactory::GetIdStatic()));
37}
38}