Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
2cfc122ebb
!20 [sync] PR-16: add some testcases for abnormal branches
From: @openeuler-sync-bot 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-12-22 02:50:12 +00:00
sherlock2010
63af76a160 add some testcases for abnormal branches
(cherry picked from commit 57a4d27bd9240a01bbb00756302c52bd245be5d0)
2022-12-16 15:35:07 +08:00
openeuler-ci-bot
c4b4a7b049
!13 fix 64 to 32 bit clang conversion warning
From: @eaglegai 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-10-24 06:09:04 +00:00
eaglegai
3ae20b90b6 fix 64 to 32 bit clang conversion warning 2022-10-24 02:21:39 +00:00
openeuler-ci-bot
69fa697fbd !9 update re2 to 20211101
Merge pull request !9 from yangl777/openEuler-22.03-LTS-Next
2021-12-21 06:03:26 +00:00
yangl777
55b31ee62f update re2 to 20211101 2021-12-16 20:13:45 +08:00
openeuler-ci-bot
965b8cd035 !4 upgrade to 20200801
From: @si-gui
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2020-12-03 16:09:31 +08:00
si-gui
59da63e1ed update to 2020-08-01 2020-12-03 11:15:39 +08:00
openeuler-ci-bot
a5ad83d096 !3 modify yaml
Merge pull request !3 from 成子晗/master
2020-07-08 11:06:49 +08:00
chengzihan2
3b2c4bab86 modify yaml 2020-07-07 15:17:19 +08:00
openeuler-ci-bot
cd2d1e4b04 !2 add re2.yaml
Merge pull request !2 from 成子晗/master
2020-05-09 19:24:13 +08:00
6 changed files with 116 additions and 6 deletions

Binary file not shown.

BIN
2021-11-01.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,42 @@
From 1e89b6846a1a2597a7e9c4ad23842e6be534b87e Mon Sep 17 00:00:00 2001
From: zhouyh <zhouyihang3@h-partners.com>
Date: Wed, 14 Dec 2022 18:42:49 +0800
Subject: [PATCH] add some testcases for abnormal branches
---
re2/testing/re2_test.cc | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/re2/testing/re2_test.cc b/re2/testing/re2_test.cc
index b1f7d73..51a1739 100644
--- a/re2/testing/re2_test.cc
+++ b/re2/testing/re2_test.cc
@@ -211,6 +211,16 @@ TEST(CheckRewriteString, all) {
TestCheckRewriteString("a(b)(c)", "f\\oo\\1", false);
}
+TEST(RE2, Rewrite) {
+ RE2 re("(foo)|(bar)baz");
+ StringPiece group[4];
+ std::string out;
+
+ ASSERT_FALSE(re.Rewrite(&out, "hello\\5", group, arraysize(group)));
+ ASSERT_FALSE(re.Rewrite(&out,"hello\\a", group, arraysize(group)));
+ ASSERT_TRUE(re.Rewrite(&out,"hello\\\\", group, arraysize(group)));
+}
+
TEST(RE2, Extract) {
std::string s;
@@ -360,6 +370,8 @@ TEST(RE2, Match) {
ASSERT_EQ(group[1], "chrisr:9000");
ASSERT_EQ(group[2], "chrisr");
ASSERT_EQ(group[3], "9000");
+ ASSERT_FALSE(
+ re.Match(s, 2, 1, RE2::UNANCHORED, group, arraysize(group)));
std::string all, host;
int port;
--
2.33.0

View File

@ -0,0 +1,53 @@
From ba2e7c2f25047a6848f2baa9bc4cb700ea9dda84 Mon Sep 17 00:00:00 2001
From: Hannah Shi <hannahshisfb@gmail.com>
Date: Fri, 3 Jun 2022 17:16:29 -0700
Subject: [PATCH] fix 64 to 32 bit clang conversion warning
Change-Id: I62e86c0e19800e128c2d2fb5f952c9ee7a7b4258
Reviewed-on: https://code-review.googlesource.com/c/re2/+/60210
Reviewed-by: Perry Lorier <perryl@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
---
util/rune.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/rune.cc b/util/rune.cc
index 4f625ea3..a40e756c 100644
--- a/util/rune.cc
+++ b/util/rune.cc
@@ -51,7 +51,7 @@ int
chartorune(Rune *rune, const char *str)
{
int c, c1, c2, c3;
- long l;
+ Rune l;
/*
* one character sequence
@@ -127,7 +127,7 @@ int
runetochar(char *str, const Rune *rune)
{
/* Runes are signed, so convert to unsigned for range check. */
- unsigned long c;
+ unsigned int c;
/*
* one character sequence
@@ -212,7 +212,7 @@ int
utflen(const char *s)
{
int c;
- long n;
+ int n;
Rune rune;
n = 0;
@@ -232,7 +232,7 @@ utflen(const char *s)
char*
utfrune(const char *s, Rune c)
{
- long c1;
+ int c1;
Rune r;
int n;

View File

@ -1,10 +1,12 @@
Name: re2
Version: 20160401
Release: 8
Version: 20211101
Release: 3
Summary: Provide backtracking RE engine
License: BSD
URL: http://github.com/google/re2/
Source0: https://github.com/google/re2/archive/2016-04-01.tar.gz
Source0: https://github.com/google/re2/archive/2021-11-01.tar.gz
Patch0: backport-fix-64-to-32-bit-clang-conversion-warning.patch
Patch1: add-some-testcases-for-abnormal-branches.patch
BuildRequires: gcc-c++
%description
@ -20,7 +22,7 @@ This package contains C ++ header files and symbolic links to re2's shared libra
If you want to develop programs using re2, you need to install re2-devel.
%prep
%autosetup -n %{name}-2016-04-01 -p1
%autosetup -n %{name}-2021-11-01 -p1
%build
%make_build CXXFLAGS="${CXXFLAGS:-%optflags} -pthread -std=c++11" \
@ -49,5 +51,17 @@ make %{?_smp_mflags} shared-test
%exclude %{_libdir}/libre2.a
%changelog
* Wed Dec 14 2022 zhouyihang <zhouyihang3@h-partners.com> - 20211101-3
- add some testcases for abnormal branches
* Mon Oct 24 2022 gaihuiying <eaglegai@163.com> - 20211101-2
- fix 64 to 32 bit clang conversion warning
* Thu Dec 16 2021 yanglu <yanglu72@huawei.com> - 20211101-1
- upgrade to 20211101
* Thu Dec 3 2020 Guoshuai Sun <sunguoshuai@huawei.com> - 20200801-1
- upgrade to 20200801
* Fri Nov 29 2019 fengbing <fengbing7@huawei.com> - 20160401-8
- Package init

View File

@ -1,4 +1,5 @@
git_url: https://github.com/google/re2
version_control: github
src_repo: google/re2
tag_prefix: ^
seperator: -
tag_prefix: "^"
seperator: ""