Welcome to mirror list, hosted at ThFree Co, Russian Federation.

wheelchair_tests.cpp « indexer_tests « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 008865d846f9c07848bdf55c21a9f7ce907482ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "testing/testing.hpp"

#include "indexer/classificator.hpp"
#include "indexer/classificator_loader.hpp"
#include "indexer/ftraits.hpp"

UNIT_TEST(Wheelchair_GetType)
{
  classificator::Load();
  Classificator const & c = classif();

  using ftraits::Wheelchair;
  using ftraits::WheelchairAvailability;

  feature::TypesHolder holder;
  {
    holder.Assign(c.GetTypeByPath({"wheelchair", "no"}));
    TEST_EQUAL(*Wheelchair::GetValue(holder), WheelchairAvailability::No, ());
  }
  {
    holder.Assign(c.GetTypeByPath({"wheelchair", "yes"}));
    TEST_EQUAL(*Wheelchair::GetValue(holder), WheelchairAvailability::Yes, ());
  }
  {
    holder.Assign(c.GetTypeByPath({"wheelchair", "limited"}));
    TEST_EQUAL(*Wheelchair::GetValue(holder), WheelchairAvailability::Limited, ());
  }
  {
    holder.Assign(c.GetTypeByPath({"amenity", "dentist"}));
    TEST(!Wheelchair::GetValue(holder), ());
  }
  {
    holder.Assign(c.GetTypeByPath({"amenity", "dentist"}));
    holder.Add(c.GetTypeByPath({"wheelchair", "yes"}));
    TEST_EQUAL(*Wheelchair::GetValue(holder), WheelchairAvailability::Yes, ());
  }
}