1 // Copyright 2017 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "xfa/fxfa/cxfa_ffbarcode.h"
6 
7 #include "testing/gtest/include/gtest/gtest.h"
8 
TEST(XFA_FFBarcode,GetBarcodeTypeByName)9 TEST(XFA_FFBarcode, GetBarcodeTypeByName) {
10   EXPECT_EQ(nullptr, CXFA_FFBarcode::GetBarcodeTypeByName(L""));
11   EXPECT_EQ(nullptr, CXFA_FFBarcode::GetBarcodeTypeByName(L"not_found"));
12 
13   auto* data = CXFA_FFBarcode::GetBarcodeTypeByName(L"ean13");
14   ASSERT_NE(nullptr, data);
15   EXPECT_EQ(BarcodeType::ean13, data->eName);
16 
17   data = CXFA_FFBarcode::GetBarcodeTypeByName(L"pdf417");
18   ASSERT_NE(nullptr, data);
19   EXPECT_EQ(BarcodeType::pdf417, data->eName);
20 
21   data = CXFA_FFBarcode::GetBarcodeTypeByName(L"code3Of9");
22   ASSERT_NE(nullptr, data);
23   EXPECT_EQ(BarcodeType::code3Of9, data->eName);
24 }
25