blob: 8f1a7d57da09e9094b1673048e47b4b097d8cdd7 [file] [log] [blame]
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
**/
#include "gtest/gtest.h"
#include "tests/message_bus_unittest_common.h"
#include "tmb/memory_mirror_message_bus.h"
#include "tmb/sqlite_message_bus.h"
namespace tmb {
template <>
MessageBus* MessageBusTest<MemoryMirrorMessageBus<false>>::CreateBus() {
SQLiteMessageBus *internal_bus = new SQLiteMessageBus("_test.db");
internal_bus->Initialize();
return new MemoryMirrorMessageBus<false>(internal_bus);
}
template <>
MessageBus* MessageBusTest<MemoryMirrorMessageBus<true>>::CreateBus() {
SQLiteMessageBus *internal_bus = new SQLiteMessageBus("_test.db");
internal_bus->Initialize();
return new MemoryMirrorMessageBus<true>(internal_bus);
}
typedef ::testing::Types<MemoryMirrorMessageBus<false>,
MemoryMirrorMessageBus<true>> TestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(MemoryMirrorWithSQLite,
MessageBusTest,
TestTypes);
INSTANTIATE_TYPED_TEST_CASE_P(MemoryMirrorWithSQLite,
ReconnectMessageBusTest,
TestTypes);
typedef ::testing::Types<MemoryMirrorMessageBus<true>> DeletionTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(MemoryMirrorWithSQLite,
SeparateDeletionMessageBusTest,
DeletionTestTypes);
} // namespace tmb