Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
29a8d43d
Commit
29a8d43d
authored
Feb 10, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed tests for copy assignment
parent
d760ff51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
src/json.hpp
src/json.hpp
+0
-1
src/json.hpp.re2c
src/json.hpp.re2c
+0
-1
test/unit.cpp
test/unit.cpp
+14
-7
No files found.
src/json.hpp
View file @
29a8d43d
...
@@ -445,7 +445,6 @@ class basic_json
...
@@ -445,7 +445,6 @@ class basic_json
/// copy assignment
/// copy assignment
inline
reference
&
operator
=
(
basic_json
other
)
noexcept
inline
reference
&
operator
=
(
basic_json
other
)
noexcept
{
{
assert
(
false
);
// not sure if function will ever be called
std
::
swap
(
m_type
,
other
.
m_type
);
std
::
swap
(
m_type
,
other
.
m_type
);
std
::
swap
(
m_value
,
other
.
m_value
);
std
::
swap
(
m_value
,
other
.
m_value
);
return
*
this
;
return
*
this
;
...
...
src/json.hpp.re2c
View file @
29a8d43d
...
@@ -445,7 +445,6 @@ class basic_json
...
@@ -445,7 +445,6 @@ class basic_json
/// copy assignment
/// copy assignment
inline reference& operator=(basic_json other) noexcept
inline reference& operator=(basic_json other) noexcept
{
{
assert(false); // not sure if function will ever be called
std::swap(m_type, other.m_type);
std::swap(m_type, other.m_type);
std::swap(m_value, other.m_value);
std::swap(m_value, other.m_value);
return *this;
return *this;
...
...
test/unit.cpp
View file @
29a8d43d
...
@@ -963,49 +963,56 @@ TEST_CASE("other constructors and destructor")
...
@@ -963,49 +963,56 @@ TEST_CASE("other constructors and destructor")
SECTION
(
"object"
)
SECTION
(
"object"
)
{
{
json
j
{{
"foo"
,
1
},
{
"bar"
,
false
}};
json
j
{{
"foo"
,
1
},
{
"bar"
,
false
}};
json
k
=
j
;
json
k
;
k
=
j
;
CHECK
(
j
==
k
);
CHECK
(
j
==
k
);
}
}
SECTION
(
"array"
)
SECTION
(
"array"
)
{
{
json
j
{
"foo"
,
1
,
42.23
,
false
};
json
j
{
"foo"
,
1
,
42.23
,
false
};
json
k
=
j
;
json
k
;
k
=
j
;
CHECK
(
j
==
k
);
CHECK
(
j
==
k
);
}
}
SECTION
(
"null"
)
SECTION
(
"null"
)
{
{
json
j
(
nullptr
);
json
j
(
nullptr
);
json
k
=
j
;
json
k
;
k
=
j
;
CHECK
(
j
==
k
);
CHECK
(
j
==
k
);
}
}
SECTION
(
"boolean"
)
SECTION
(
"boolean"
)
{
{
json
j
(
true
);
json
j
(
true
);
json
k
=
j
;
json
k
;
k
=
j
;
CHECK
(
j
==
k
);
CHECK
(
j
==
k
);
}
}
SECTION
(
"string"
)
SECTION
(
"string"
)
{
{
json
j
(
"Hello world"
);
json
j
(
"Hello world"
);
json
k
=
j
;
json
k
;
k
=
j
;
CHECK
(
j
==
k
);
CHECK
(
j
==
k
);
}
}
SECTION
(
"number (integer)"
)
SECTION
(
"number (integer)"
)
{
{
json
j
(
42
);
json
j
(
42
);
json
k
=
j
;
json
k
;
k
=
j
;
CHECK
(
j
==
k
);
CHECK
(
j
==
k
);
}
}
SECTION
(
"number (floating-point)"
)
SECTION
(
"number (floating-point)"
)
{
{
json
j
(
42.23
);
json
j
(
42.23
);
json
k
=
j
;
json
k
;
k
=
j
;
CHECK
(
j
==
k
);
CHECK
(
j
==
k
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment