OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com.mapd.tests.DateTimeTest.Fuzzy Enum Reference

Static Public Member Functions

static Fuzzy compare (LocalDateTime expected, LocalDateTime result, Encoding enc)
 
static Fuzzy compare (long expected, long result)
 
static Fuzzy compareDateAdd (LocalDateTime expected, LocalDateTime result, Encoding enc)
 

Public Attributes

 ok
 
 okish
 

Detailed Description

Definition at line 985 of file DateTimeTest.java.

Member Function Documentation

static Fuzzy com.mapd.tests.DateTimeTest.Fuzzy.compare ( LocalDateTime  expected,
LocalDateTime  result,
Encoding  enc 
)
inlinestatic

Definition at line 990 of file DateTimeTest.java.

References com.mapd.tests.DateTimeTest.Fuzzy.okish.

990  {
991  if (expected.equals(result)) return ok;
992 
993  LocalDateTime okish = result.minus(1, ChronoUnit.NANOS);
994  okish = enc.clear(okish);
995 
996  if (expected.equals(okish)) return Fuzzy.okish;
997 
998  okish = result.plus(1, ChronoUnit.NANOS);
999  okish = enc.clear(okish);
1000 
1001  if (expected.equals(okish)) return Fuzzy.okish;
1002 
1003  return failed;
1004  }
static Fuzzy com.mapd.tests.DateTimeTest.Fuzzy.compare ( long  expected,
long  result 
)
inlinestatic

Definition at line 1006 of file DateTimeTest.java.

References com.mapd.tests.DateTimeTest.Fuzzy.okish.

1006  {
1007  if (expected == result) return ok;
1008 
1009  long okish = result - 1;
1010 
1011  if (expected == okish) return Fuzzy.okish;
1012 
1013  okish = result + 1;
1014 
1015  if (expected == okish) return Fuzzy.okish;
1016 
1017  if ((result == 59 && expected == 0) || (result == 0 && expected == 59)) {
1018  // for minutes and seconds
1019  return Fuzzy.okish;
1020  }
1021 
1022  if ((result == 23 && expected == 0) || (result == 0 && expected == 23)) {
1023  // for hours
1024  return Fuzzy.okish;
1025  }
1026 
1027  return failed;
1028  }
static Fuzzy com.mapd.tests.DateTimeTest.Fuzzy.compareDateAdd ( LocalDateTime  expected,
LocalDateTime  result,
Encoding  enc 
)
inlinestatic

Definition at line 1030 of file DateTimeTest.java.

References com.mapd.tests.DateTimeTest.Fuzzy.okish.

1031  {
1032  if (expected.equals(result)) return ok;
1033 
1034  LocalDateTime okish = result.minus(1, ChronoUnit.NANOS);
1035  okish = enc.clearForDateAddResult(okish);
1036 
1037  if (expected.equals(okish)) return Fuzzy.okish;
1038 
1039  okish = result.plus(1, ChronoUnit.NANOS);
1040  okish = enc.clearForDateAddResult(okish);
1041 
1042  if (expected.equals(okish)) return Fuzzy.okish;
1043 
1044  return failed;
1045  }

Member Data Documentation

com.mapd.tests.DateTimeTest.Fuzzy.ok

Definition at line 986 of file DateTimeTest.java.


The documentation for this enum was generated from the following file: