diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-08-21 07:59:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 07:59:11 +0200 |
commit | 415e9e002e4207809247b6bd5f9419960ab43ed1 (patch) | |
tree | 0111e27fb0b3e494401a98279d36c58b48c3d265 /document/src/tests/fieldvalue | |
parent | be5759f30affe0e38ea4c442586a457f9cb698f8 (diff) |
Revert "doc: -> id:"
Diffstat (limited to 'document/src/tests/fieldvalue')
-rw-r--r-- | document/src/tests/fieldvalue/referencefieldvalue_test.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/document/src/tests/fieldvalue/referencefieldvalue_test.cpp b/document/src/tests/fieldvalue/referencefieldvalue_test.cpp index 17fb5ac74e6..d34bbff8a54 100644 --- a/document/src/tests/fieldvalue/referencefieldvalue_test.cpp +++ b/document/src/tests/fieldvalue/referencefieldvalue_test.cpp @@ -23,8 +23,8 @@ struct Fixture { ~Fixture(); }; - Fixture::Fixture() = default; - Fixture::~Fixture() = default; + Fixture::Fixture() { } + Fixture::~Fixture() { } } using vespalib::IllegalArgumentException; @@ -60,6 +60,17 @@ TEST_F("Exception is thrown if constructor doc ID type does not match referenced "to reference of document type 'foo'"); } +TEST_F("Exception is thrown if doc ID does not have a type", Fixture) { + // Could have had a special cased message for this, but type-less IDs are + // not expected to be allowed through the feed pipeline at all. We just + // want to ensure it fails in a controlled fashion if encountered. + EXPECT_EXCEPTION( + ReferenceFieldValue(f.refType, DocumentId("doc:foo:bario")), + IllegalArgumentException, + "Can't assign document ID 'doc:foo:bario' (of type '') " + "to reference of document type 'foo'"); +} + TEST_F("assign()ing a non-reference field value throws exception", Fixture) { ReferenceFieldValue fv(f.refType); EXPECT_EXCEPTION(fv.assign(StringFieldValue("waluigi time!!")), |