Initial import (#1693541)

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
epel9
Robert-André Mauchin 6 years ago
parent acd2a0f779
commit 6f6562810b

@ -0,0 +1,101 @@
From e96d118f7b915ff65e6c14dcccdecffb664f94ab Mon Sep 17 00:00:00 2001
From: Evgeny Safronov <division494@gmail.com>
Date: Mon, 22 Jan 2018 22:08:00 +0300
Subject: [PATCH] fix: weaken cursor restrictions in tests (#158)
Related to https://github.com/rust-lang/rust/issues/47640.
---
rmp/src/decode/str.rs | 2 +-
rmp/tests/func/decode/array.rs | 4 ++--
rmp/tests/func/decode/sint.rs | 6 +++---
rmp/tests/func/decode/string.rs | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/rmp/src/decode/str.rs b/rmp/src/decode/str.rs
index cc92659..4041f1c 100644
--- a/rmp/src/decode/str.rs
+++ b/rmp/src/decode/str.rs
@@ -107,7 +107,7 @@ fn read_str_len_with_nread<R>(rd: &mut R) -> Result<(u32, usize), ValueReadError
///
/// This function is **unstable**, because it needs review.
// TODO: Stabilize. Mark error values for each error case (in docs).
-pub fn read_str<'r, R>(rd: &mut R, mut buf: &'r mut [u8]) -> Result<&'r str, DecodeStringError<'r>>
+pub fn read_str<'r, R>(rd: &mut R, buf: &'r mut [u8]) -> Result<&'r str, DecodeStringError<'r>>
where R: Read
{
let len = try!(read_str_len(rd));
diff --git a/rmp/tests/func/decode/array.rs b/rmp/tests/func/decode/array.rs
index 70492e1..1174642 100644
--- a/rmp/tests/func/decode/array.rs
+++ b/rmp/tests/func/decode/array.rs
@@ -48,7 +48,7 @@ fn from_array16_unexpected_eof_read_size() {
let mut cur = Cursor::new(buf);
read_array_len(&mut cur).err().unwrap();
- assert_eq!(2, cur.position());
+ assert!(cur.position() >= 1);
}
#[test]
@@ -75,7 +75,7 @@ fn from_array32_unexpected_eof_read_size() {
let mut cur = Cursor::new(buf);
read_array_len(&mut cur).err().unwrap();
- assert_eq!(4, cur.position());
+ assert!(cur.position() >= 1);
}
#[test]
diff --git a/rmp/tests/func/decode/sint.rs b/rmp/tests/func/decode/sint.rs
index ba19548..ddf46ce 100644
--- a/rmp/tests/func/decode/sint.rs
+++ b/rmp/tests/func/decode/sint.rs
@@ -108,7 +108,7 @@ fn from_i16_unexpected_eof() {
let mut cur = Cursor::new(&buf[..]);
read_i16(&mut cur).err().unwrap();
- assert_eq!(2, cur.position());
+ assert!(cur.position() >= 1);
}
#[test]
@@ -147,7 +147,7 @@ fn from_i32_unexpected_eof() {
let mut cur = Cursor::new(&buf[..]);
read_i32(&mut cur).err().unwrap();
- assert_eq!(4, cur.position());
+ assert!(cur.position() >= 1);
}
#[test]
@@ -186,7 +186,7 @@ fn from_i64_unexpected_eof() {
let mut cur = Cursor::new(&buf[..]);
read_i64(&mut cur).err().unwrap();
- assert_eq!(8, cur.position());
+ assert!(cur.position() >= 1);
}
#[test]
diff --git a/rmp/tests/func/decode/string.rs b/rmp/tests/func/decode/string.rs
index 1175141..6f6dd83 100644
--- a/rmp/tests/func/decode/string.rs
+++ b/rmp/tests/func/decode/string.rs
@@ -90,7 +90,7 @@ fn from_str16_read_str_len_eof() {
let mut cur = Cursor::new(buf);
read_str_len(&mut cur).err().unwrap();
- assert_eq!(2, cur.position());
+ assert!(cur.position() >= 1);
}
#[test]
@@ -117,7 +117,7 @@ fn from_str32_read_str_len_eof() {
let mut cur = Cursor::new(buf);
read_str_len(&mut cur).err().unwrap();
- assert_eq!(4, cur.position());
+ assert!(cur.position() >= 1);
}
#[test]

Binary file not shown.

@ -0,0 +1,11 @@
--- rmp-0.8.7/Cargo.toml 1970-01-01T01:00:00+01:00
+++ rmp-0.8.7/Cargo.toml 2019-03-28T07:17:27.537848+01:00
@@ -25,6 +25,6 @@
version = "1"
[dependencies.num-traits]
-version = "0.1"
+version = "0.2"
[dev-dependencies.quickcheck]
-version = "0.3"
+version = "0.8"

@ -0,0 +1,80 @@
# Generated by rust2rpm
%bcond_without check
%global debug_package %{nil}
%global crate rmp
Name: rust-%{crate}
Version: 0.8.7
Release: 1%{?dist}
Summary: Pure Rust MessagePack serialization implementation
# https://github.com/3Hren/msgpack-rust/issues/192
License: MIT
URL: https://crates.io/crates/rmp
Source: %{crates_source}
# Initial patched metadata
# - Bump num-traits to 0.2 https://github.com/3Hren/msgpack-rust/pull/193
# - Bump quickcheck to 0.8 https://github.com/3Hren/msgpack-rust/pull/194
Patch0: rmp-fix-metadata.diff
# Patch which fix some tests
Patch1: https://github.com/3Hren/msgpack-rust/commit/e96d118f7b915ff65e6c14dcccdecffb664f94ab.patch#/0001-fix-weaken-cursor-restrictions-in-tests.patch
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging
BuildRequires: (crate(byteorder/default) >= 1.0.0 with crate(byteorder/default) < 2.0.0)
BuildRequires: (crate(num-traits/default) >= 0.2.0 with crate(num-traits/default) < 0.3.0)
%if %{with check}
BuildRequires: (crate(quickcheck/default) >= 0.8.0 with crate(quickcheck/default) < 0.9.0)
%endif
%global _description \
Pure Rust MessagePack serialization implementation.
%description %{_description}
%package devel
Summary: %{summary}
BuildArch: noarch
%description devel %{_description}
This package contains library source intended for building other packages
which use "%{crate}" crate.
%files devel
%doc CHANGELOG.md README.md
%{cargo_registry}/%{crate}-%{version}/
%package -n %{name}+default-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+default-devel %{_description}
This package contains library source intended for building other packages
which use "default" feature of "%{crate}" crate.
%files -n %{name}+default-devel
%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml
%prep
%autosetup -N -n %{crate}-%{version_no_tilde}
%patch0 -p1
%patch1 -p2
%cargo_prep
%build
%cargo_build
%install
%cargo_install
%if %{with check}
%check
%cargo_test
%endif
%changelog
* Thu Mar 28 07:18:34 CET 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.8.7-1
- Initial package
Loading…
Cancel
Save