implemented create_atoms and encode_image_flags and unit tests for them; added IMGMASK and friends to extract_setting and unit tests for them; wrote documentation for them
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include "lammps.h"
|
||||
#include "library.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
@ -18,6 +19,8 @@ int f_lammps_get_mpi_comm();
|
||||
int f_lammps_extract_setting(const char *);
|
||||
int f_lammps_has_error();
|
||||
int f_lammps_get_last_error_message(char *, int);
|
||||
int f_lammps_get_image_flags_int(int, int, int);
|
||||
int64_t f_lammps_get_image_flags_bigint(int, int, int);
|
||||
}
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
@ -85,9 +88,17 @@ TEST_F(LAMMPS_properties, extract_setting)
|
||||
#if defined(LAMMPS_BIGBIG)
|
||||
EXPECT_EQ(f_lammps_extract_setting("tagint"), 8);
|
||||
EXPECT_EQ(f_lammps_extract_setting("imageint"), 8);
|
||||
EXPECT_EQ(f_lammps_extract_setting("IMGMASK"), 2097151);
|
||||
EXPECT_EQ(f_lammps_extract_setting("IMGMAX"), 1048576);
|
||||
EXPECT_EQ(f_lammps_extract_setting("IMGBITS"), 21);
|
||||
EXPECT_EQ(f_lammps_extract_setting("IMG2BITS"), 42);
|
||||
#else
|
||||
EXPECT_EQ(f_lammps_extract_setting("tagint"), 4);
|
||||
EXPECT_EQ(f_lammps_extract_setting("imageint"), 4);
|
||||
EXPECT_EQ(f_lammps_extract_setting("IMGMASK"), 1023);
|
||||
EXPECT_EQ(f_lammps_extract_setting("IMGMAX"), 512);
|
||||
EXPECT_EQ(f_lammps_extract_setting("IMGBITS"), 10);
|
||||
EXPECT_EQ(f_lammps_extract_setting("IMG2BITS"), 20);
|
||||
#endif
|
||||
|
||||
EXPECT_EQ(f_lammps_extract_setting("box_exist"), 0);
|
||||
@ -141,4 +152,24 @@ TEST_F(LAMMPS_properties, has_error)
|
||||
EXPECT_EQ(err, 0);
|
||||
EXPECT_THAT(errmsg, ContainsRegex(" "));
|
||||
};
|
||||
|
||||
TEST_F(LAMMPS_properties, get_image_flags)
|
||||
{
|
||||
#ifdef LAMMPS_BIGBIG
|
||||
int64_t image = f_lammps_get_image_flags_bigint(0,0,0);
|
||||
int64_t Cimage = lammps_encode_image_flags(0,0,0);
|
||||
EXPECT_EQ(image, Cimage);
|
||||
image = f_lammps_get_image_flags_bigint(1,-1,1);
|
||||
Cimage = lammps_encode_image_flags(1,-1,1);
|
||||
EXPECT_EQ(image, Cimage);
|
||||
#else
|
||||
int image = f_lammps_get_image_flags_int(0,0,0);
|
||||
int Cimage = lammps_encode_image_flags(0,0,0);
|
||||
EXPECT_EQ(image, Cimage);
|
||||
image = f_lammps_get_image_flags_int(1,-1,1);
|
||||
Cimage = lammps_encode_image_flags(1,-1,1);
|
||||
EXPECT_EQ(image, Cimage);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace LAMMPS_NS
|
||||
|
||||
Reference in New Issue
Block a user