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 #include "third_party/base/ptr_util.h" 9 10 TEST(XFA_FFBarcode, GetBarcodeTypeByName) { 11 EXPECT_EQ(nullptr, CXFA_FFBarcode::GetBarcodeTypeByName(L"")); 12 EXPECT_EQ(nullptr, CXFA_FFBarcode::GetBarcodeTypeByName(L"not_found")); 13 14 auto* data = CXFA_FFBarcode::GetBarcodeTypeByName(L"ean13"); 15 ASSERT_NE(nullptr, data); 16 EXPECT_EQ(BarcodeType::ean13, data->eName); 17 18 data = CXFA_FFBarcode::GetBarcodeTypeByName(L"pdf417"); 19 ASSERT_NE(nullptr, data); 20 EXPECT_EQ(BarcodeType::pdf417, data->eName); 21 22 data = CXFA_FFBarcode::GetBarcodeTypeByName(L"code3Of9"); 23 ASSERT_NE(nullptr, data); 24 EXPECT_EQ(BarcodeType::code3Of9, data->eName); 25 } 26