OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 989 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 994 of file DateTimeTest.java.

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

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

Definition at line 1010 of file DateTimeTest.java.

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

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

Definition at line 1034 of file DateTimeTest.java.

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

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

Member Data Documentation

com.mapd.tests.DateTimeTest.Fuzzy.ok

Definition at line 990 of file DateTimeTest.java.


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